fix and update

This commit is contained in:
lendry
2026-07-01 14:34:55 +03:00
parent 55deb5c152
commit 0c9b8e2629
6 changed files with 137 additions and 19 deletions

View File

@@ -33,6 +33,7 @@ import {
subscribeApiReady,
subscribeApiNotReady,
} from '@/lib/api';
import { finalizeFedcmLogin, shouldFinalizeFedcmLogin } from '@/lib/fedcm-login-bridge';
import { useToast } from './toast-provider';
import { PinLockModal } from './pin-lock-modal';
import { AppBootstrapScreen } from './app-bootstrap-screen';
@@ -254,7 +255,11 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {
});
if (auth.pinVerified !== false) {
scheduleFedcmSessionSync(auth.accessToken, 8000);
if (typeof window !== 'undefined' && shouldFinalizeFedcmLogin(window.location.pathname)) {
void finalizeFedcmLogin(auth.accessToken);
} else {
scheduleFedcmSessionSync(auth.accessToken, 8000);
}
}
},
[activatePinLock, clearPinLock, showToast]