From ddfb49277abdacd3175a8fb820be58d276ef4ab6 Mon Sep 17 00:00:00 2001 From: Casper Lai Date: Sat, 3 Jun 2017 02:09:23 +0800 Subject: [PATCH] Simple token auth --- src/LoginUsers.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/LoginUsers.php b/src/LoginUsers.php index f9c3011..1fbc56d 100644 --- a/src/LoginUsers.php +++ b/src/LoginUsers.php @@ -39,11 +39,9 @@ public function login() $rawUser = Socialite::driver('km')->user(); try { - $user = $this->performLogin($rawUser); + $token = $this->performLogin($rawUser); - Auth::login($user); - - return response()->json($user)->header('Authorization', "Bearer: {$user->getApiToken()}"); + return response()->json([])->header('Authorization', "Bearer: {$token}"); } catch (DenyException $ex) { return response()->json([], 404); }