|
@ -95,6 +95,9 @@ class AuthenticationController extends Controller |
|
|
if (!isset($user)) |
|
|
if (!isset($user)) |
|
|
{ |
|
|
{ |
|
|
abort(500); |
|
|
abort(500); |
|
|
|
|
|
// We die() after each abort to help the static analyzer (phan) |
|
|
|
|
|
// along, otherwise it doesn't realize that abort ends execution |
|
|
|
|
|
// and is worried that we've hit the below code in an invalid state. |
|
|
die(); |
|
|
die(); |
|
|
} |
|
|
} |
|
|
elseif (!method_exists($user, 'save')) |
|
|
elseif (!method_exists($user, 'save')) |
|
@ -118,9 +121,7 @@ class AuthenticationController extends Controller |
|
|
die(); |
|
|
die(); |
|
|
} |
|
|
} |
|
|
$token->refresh_token = $refresh_token; |
|
|
$token->refresh_token = $refresh_token; |
|
|
// @phan-suppress-next-line PhanNonClassMethodCall |
|
|
|
|
|
$token->user_id = $user->{$user->getAuthIdentifierName()}; |
|
|
$token->user_id = $user->{$user->getAuthIdentifierName()}; |
|
|
// @phan-suppress-next-line PhanNonClassMethodCall |
|
|
|
|
|
$token->save(); |
|
|
$token->save(); |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
@ -137,12 +138,12 @@ class AuthenticationController extends Controller |
|
|
{ |
|
|
{ |
|
|
// TODO: Log a useful error message |
|
|
// TODO: Log a useful error message |
|
|
abort(500); |
|
|
abort(500); |
|
|
|
|
|
die(); |
|
|
} |
|
|
} |
|
|
// If nothing handled the login event, assume we're using laravel default |
|
|
// If nothing handled the login event, assume we're using laravel default |
|
|
// everything and just go ahead and update the name/email |
|
|
// everything and just go ahead and update the name/email |
|
|
$user->name = $user_info['name']; |
|
|
$user->name = $user_info['name']; |
|
|
$user->email = $user_info['email']; |
|
|
$user->email = $user_info['email']; |
|
|
// @phan-suppress-next-line PhanNonClassMethodCall |
|
|
|
|
|
$user->save(); |
|
|
$user->save(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|