From 19940f599d99cbe690a8a2b418ea5fdaf4478157 Mon Sep 17 00:00:00 2001 From: Tokumeikoi Date: Sun, 16 Feb 2020 13:48:31 +0800 Subject: [PATCH] fix admin login --- app/Http/Controllers/Passport/AuthController.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Passport/AuthController.php b/app/Http/Controllers/Passport/AuthController.php index 8a53b3b0..be2c45f4 100644 --- a/app/Http/Controllers/Passport/AuthController.php +++ b/app/Http/Controllers/Passport/AuthController.php @@ -175,9 +175,13 @@ class AuthController extends Controller public function check(Request $request) { - return response([ + $response = [ 'data' => $request->session()->get('id') ? true : false - ]); + ]; + if ($request->session()->get('is_admin')) { + $response['is_admin'] = true; + } + return response($response); } public function forget(AuthForget $request)