angular / angular/angularfire

signInWithCredential get stuck

Open
#3,646 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
7.8k
Forks
2.2k
Avg merge
22h 28m
Merged PRs (30d)
6

Description

# 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 {
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.

Contributor guide

Open the contributing guide

Research direction

Start at the loginWithGoogle method in auth.service.ts and reproduce the native path with the listed Angular, Firebase, Ionic, and Capacitor versions. Compare the behavior around SocialLogin.login, GoogleAuthProvider.credential, and signInWithCredential, and verify that the device no longer becomes unresponsive and that failures produce an error.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, firebase, typescript
Domain
authentication, mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.