|
@@ -60,10 +60,14 @@ class LoginController extends Controller
|
|
|
if ($request->hasSession()) {
|
|
if ($request->hasSession()) {
|
|
|
$request->session()->put('auth.password_confirmed_at', time());
|
|
$request->session()->put('auth.password_confirmed_at', time());
|
|
|
}
|
|
}
|
|
|
- if ($request->session()->has('token_fcm') && auth()->id()) {
|
|
|
|
|
- $token = trim((string)$request->session()->get('token_fcm'));
|
|
|
|
|
|
|
+ if (auth()->id()) {
|
|
|
|
|
+ $tokenFromRequest = trim((string)$request->input('token_fcm', ''));
|
|
|
|
|
+ $tokenFromSession = trim((string)$request->session()->get('token_fcm', ''));
|
|
|
|
|
+ $token = $tokenFromRequest !== '' ? $tokenFromRequest : $tokenFromSession;
|
|
|
|
|
+
|
|
|
if ($token !== '') {
|
|
if ($token !== '') {
|
|
|
User::assignUniqueFcmToken((int)auth()->id(), $token);
|
|
User::assignUniqueFcmToken((int)auth()->id(), $token);
|
|
|
|
|
+ $request->session()->put('token_fcm', $token);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
return $this->sendLoginResponse($request);
|
|
return $this->sendLoginResponse($request);
|