Skip to content

Commit

Permalink
Simple token auth
Browse files Browse the repository at this point in the history
  • Loading branch information
CasperLaiTW committed Jun 2, 2017
1 parent abd642c commit ddfb492
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/LoginUsers.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit ddfb492

Please sign in to comment.