mirror of https://github.com/getmango/Mango.git
Include admin info in /api/signin response
This commit is contained in:
parent
7ae0577e4e
commit
d1de8b7a4e
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue