|
@@ -63,7 +63,10 @@ class LoginController extends Controller
|
|
|
if (auth()->id()) {
|
|
if (auth()->id()) {
|
|
|
$tokenFromRequest = trim((string)$request->input('token_fcm', ''));
|
|
$tokenFromRequest = trim((string)$request->input('token_fcm', ''));
|
|
|
$tokenFromSession = trim((string)$request->session()->get('token_fcm', ''));
|
|
$tokenFromSession = trim((string)$request->session()->get('token_fcm', ''));
|
|
|
- $token = $tokenFromRequest !== '' ? $tokenFromRequest : $tokenFromSession;
|
|
|
|
|
|
|
+ $tokenFromCookie = trim((string)$request->cookie('token_fcm', ''));
|
|
|
|
|
+ $token = $tokenFromRequest !== ''
|
|
|
|
|
+ ? $tokenFromRequest
|
|
|
|
|
+ : ($tokenFromSession !== '' ? $tokenFromSession : $tokenFromCookie);
|
|
|
|
|
|
|
|
if ($token !== '') {
|
|
if ($token !== '') {
|
|
|
User::assignUniqueFcmToken((int)auth()->id(), $token);
|
|
User::assignUniqueFcmToken((int)auth()->id(), $token);
|