fix and update
This commit is contained in:
@@ -22,7 +22,8 @@ import {
|
||||
PublicUser,
|
||||
refreshAuthSession,
|
||||
resetPinRequiredNotification,
|
||||
setPinRequiredHandler
|
||||
setPinRequiredHandler,
|
||||
syncFedcmSession
|
||||
} from '@/lib/api';
|
||||
import { useToast } from './toast-provider';
|
||||
import { PinLockModal } from './pin-lock-modal';
|
||||
@@ -89,6 +90,10 @@ function applySessionState(
|
||||
setters.activatePinLock(session.sessionId ?? '');
|
||||
} else {
|
||||
setters.clearPinLock();
|
||||
const accessToken = window.localStorage.getItem(AUTH_TOKEN_KEY);
|
||||
if (accessToken) {
|
||||
void syncFedcmSession(accessToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,6 +159,9 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {
|
||||
cacheUserProfile(auth.user);
|
||||
setHasStoredSession(true);
|
||||
clearPinLock();
|
||||
if (auth.pinVerified !== false) {
|
||||
void syncFedcmSession(auth.accessToken);
|
||||
}
|
||||
},
|
||||
[clearPinLock]
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user