login for RN app

This commit is contained in:
seb
2026-07-19 23:42:17 +02:00
parent af9e072427
commit c5b2f06919
7 changed files with 199 additions and 29 deletions

View File

@@ -13,6 +13,7 @@ import {
FEDCM_BLOCKED_MESSAGE,
GoogleSignInBlockedError,
GoogleSignInCancelledError,
logError,
requestGoogleIdToken,
} from '../auth/googleSignIn';
@@ -36,11 +37,32 @@ export default function LoginPage() {
await loginWithGoogle(idToken);
} catch (err) {
if (err instanceof GoogleSignInCancelledError) return;
logError('[login] Google sign-in failed', {
message: err?.message,
name: err?.name,
code: err?.code,
status: err?.status,
cause: err?.cause,
stack: err?.stack,
clientId: googleClientId,
origin: window.location.origin,
href: window.location.href,
dashHost: window.__dashHost
? {
isDashNative: window.__dashHost.isDashNative,
googleSignIn: window.__dashHost.googleSignIn,
}
: null,
error: err,
});
if (err instanceof GoogleSignInBlockedError) {
enqueueSnackbar(err.message, { variant: 'warning', autoHideDuration: 12000 });
return;
}
enqueueSnackbar(`Login failed: ${err.message}`, { variant: 'error' });
const detail = [err?.message || String(err), err?.code, err?.status]
.filter(Boolean)
.join(' · ');
enqueueSnackbar(`Login failed: ${detail}`, { variant: 'error' });
} finally {
setBusy(false);
}