success! moderator access granted

This commit is contained in:
winter 2023-01-09 20:58:49 +09:00
parent 964e6c28ee
commit f0090f75bc
1 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,16 @@
require "uri"
include CrystalGauntlet
CrystalGauntlet.endpoints["/requestUserAccess.php"] = ->(context : HTTP::Server::Context): String {
params = URI::Params.parse(context.request.body.not_nil!.gets_to_end)
LOG.debug { params.inspect }
user_id, account_id = Accounts.auth(params)
if !(user_id && account_id)
return "-1"
end
rank = Ranks.get_rank(account_id)
rank.is_mod ? "1" : "-1"
}