--- a/mod_invites_api/mod_invites_api.lua Fri Oct 16 14:25:44 2020 +0100
+++ b/mod_invites_api/mod_invites_api.lua Fri Oct 16 14:26:53 2020 +0100
@@ -54,6 +54,10 @@
return 403;
end
+ if api_user.allowed_methods and not api_user.allowed_methods[event.request.method] then
+ return 405;
+ end
+
local invite = invites.create_account(nil, { source = "api/token/"..api_user.id });
if not invite then
return 500;
@@ -104,6 +108,7 @@
token = token;
name = arg[1];
created_at = os.time();
+ allowed_methods = { GET = true, POST = true };
});
print(id.."/"..token);
elseif command == "delete" then