mirror of
https://github.com/hkalexling/Mango.git
synced 2026-01-05 00:00:50 -05:00
Include admin info in /api/signin response
This commit is contained in:
@@ -86,9 +86,10 @@ struct APIRouter
|
||||
"password" => String,
|
||||
}
|
||||
Koa.response 200, schema: {
|
||||
"success" => Bool,
|
||||
"error" => String?,
|
||||
"token" => String?,
|
||||
"success" => Bool,
|
||||
"error" => String?,
|
||||
"session_id" => String?,
|
||||
"is_admin" => Bool?,
|
||||
}
|
||||
Koa.tag "users"
|
||||
post "/api/login" do |env|
|
||||
@@ -101,6 +102,7 @@ struct APIRouter
|
||||
send_json env, {
|
||||
"success" => true,
|
||||
"session_id" => env.session.id,
|
||||
"is_admin" => Storage.default.username_is_admin username,
|
||||
}.to_json
|
||||
rescue e
|
||||
Logger.error e
|
||||
|
||||
Reference in New Issue
Block a user