Skip to content

signInWithCredential get stuck #3646

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ingrocha opened this issue Apr 19, 2025 · 1 comment
Open

signInWithCredential get stuck #3646

ingrocha opened this issue Apr 19, 2025 · 1 comment

Comments

@ingrocha
Copy link

Version info

"@angular/core": "19.2.3"
"@angular/fire": "^19.0.0",
"firebase": "^10.14.1",
"@ionic/angular": "^8.3.4",
"@capacitor/core": "^6.1.0",

Code

import { Auth, GoogleAuthProvider, signInWithCredential, signInWithPopup, UserCredential } from '@angular/fire/auth';

private auth = inject(Auth); //* Firebase Auth instance

async loginWithGoogle(): Promise<UserCredential> {
        SummonLogger.trace('auth.service.ts', 'loginWithGoogle');
        try {
            const provider = new GoogleAuthProvider();

            if (!Capacitor.isNativePlatform()) {
                return signInWithPopup(this.auth, provider);
            } else {
                // Native auth (capacitor)
                await this.initGoogleProvider();
                await this.clearGoogleSocialLoginSession();
                const res = await SocialLogin.login({ provider: 'google', options: {} });
                this.provider = 'google';
                const googleResult = res.result as GoogleLoginResponse;
                const credential = GoogleAuthProvider.credential(googleResult.idToken);
                return await signInWithCredential(this.auth, credential);
            }
        } catch (error) {
            SummonLogger.error('auth.service.ts', 'loginWithGoogle() - error', error);
            return Promise.reject(error);
        }
    }

Issue

When the signInWithCredential method is invoked, the device becomes unresponsive, seemingly freezing in place. Despite this halt in functionality, no error messages or alerts are displayed to indicate the problem.

@google-oss-bot
Copy link

This issue does not seem to follow the issue template. Make sure you provide all the required information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants