fix: restore GoogleAuth.initialize on native to prevent startup NullPointerException crash

This commit is contained in:
2026-06-27 20:32:59 +07:00
parent eaf79eaf8f
commit 1417f40dde
2 changed files with 11 additions and 13 deletions
+10 -12
View File
@@ -26,18 +26,16 @@ function rewriteUrls(obj: any, backendUrl: string): any {
return obj;
}
if (!Capacitor.isNativePlatform()) {
// Initialize Web/PWA Google Login client
try {
GoogleAuth.initialize({
clientId: import.meta.env.VITE_GOOGLE_CLIENT_ID || '639044397050-7hair384u6lle941h033trut1s3q47l4.apps.googleusercontent.com',
scopes: ['profile', 'email'],
grantOfflineAccess: true,
});
console.log('[Web OAuth] GoogleAuth initialized successfully.');
} catch (e) {
console.error('[Web OAuth] Failed to initialize GoogleAuth client:', e);
}
// Initialize Google Login client to prevent NullPointerException crashes on Android
try {
GoogleAuth.initialize({
clientId: import.meta.env.VITE_GOOGLE_CLIENT_ID || '639044397050-7hair384u6lle941h033trut1s3q47l4.apps.googleusercontent.com',
scopes: ['profile', 'email'],
grantOfflineAccess: true,
});
console.log('[OAuth] GoogleAuth initialized successfully.');
} catch (e) {
console.error('[OAuth] Failed to initialize GoogleAuth client:', e);
}
if (Capacitor.isNativePlatform()) {