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