Add fallback Google OAuth Token input modal and explicit domain configuration dialog
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user