equal
deleted
inserted
replaced
110 invite_options = json.decode(event.request.body); |
110 invite_options = json.decode(event.request.body); |
111 if not invite_options then |
111 if not invite_options then |
112 module:log("warn", "Invalid JSON"); |
112 module:log("warn", "Invalid JSON"); |
113 return 400; |
113 return 400; |
114 end |
114 end |
|
115 else |
|
116 invite_options = {}; |
115 end |
117 end |
116 |
118 |
117 local invite; |
119 local invite; |
118 if invite_options and invite_options.reusable then |
120 if invite_options.reusable then |
119 invite = invites.create_group(invite_options.groups, invite_options.ttl, { |
121 invite = invites.create_group(invite_options.groups, invite_options.ttl, { |
120 source = "admin_api/"..event.session.username; |
122 source = "admin_api/"..event.session.username; |
121 }); |
123 }); |
122 else |
124 else |
123 invite = invites.create_account(nil, { |
125 invite = invites.create_account(nil, { |