Add fallback Google OAuth Token input modal and explicit domain configuration dialog

This commit is contained in:
2026-07-22 19:21:00 -04:00
parent 2fbf7ecd8b
commit 76f913e21e
2 changed files with 73 additions and 12 deletions
+7 -1
View File
@@ -51,8 +51,14 @@ export const googleWorkspaceSignIn = async (): Promise<{ user: User; accessToken
}
cachedAccessToken = credential.accessToken;
return { user: result.user, accessToken: cachedAccessToken };
} catch (error) {
} catch (error: any) {
console.error('Google Workspace Sign-in Error:', error);
// Check if error is due to domain restriction or cross-origin popup block
const errCode = error?.code || '';
if (errCode.includes('unauthorized-domain') || errCode.includes('popup-closed') || errCode.includes('auth/invalid-api-key')) {
throw new Error(`Google Auth Domain Restriction: Your local origin (localhost:3000) is not listed in the Firebase/Google Auth authorized domains. Error Code: ${errCode}`);
}
throw error;
} finally {
isSigningIn = false;