signInWithCredential get stuck
- Vorherrschende Sprache
- TypeScript
- Sterne
- 7.8k
- Forks
- 2.2k
- Ø Merge
- 22 Std. 28 Min.
- Gemergte PRs (30 T.)
- 6
Beschreibung
# 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.
Beitragsleitfaden
Rechercherichtung
Beginne bei der Methode loginWithGoogle in auth.service.ts und reproduziere den nativen Pfad mit den aufgeführten Versionen von Angular, Firebase, Ionic und Capacitor. Vergleiche das Verhalten rund um SocialLogin.login, GoogleAuthProvider.credential und signInWithCredential und überprüfe, dass das Gerät nicht mehr nicht reagiert und dass Fehler einen Fehler erzeugen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- angular, firebase, typescript
- Bereich
- authentication, mobile-dev
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100