signInWithCredential get stuck
- 主要语言
- TypeScript
- 星标
- 7.8k
- 派生
- 2.2k
- 平均合并
- 22 小时 28 分钟
- 30 天内合并 PR
- 6
描述
# 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.
贡献指南
调研方向
从 auth.service.ts 中的 loginWithGoogle 方法开始,使用所列出的 Angular、Firebase、Ionic 和 Capacitor 版本复现原生路径。比较 SocialLogin.login、GoogleAuthProvider.credential 和 signInWithCredential 附近的行为,并验证设备不再无响应,且失败会产生错误。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- angular, firebase, typescript
- 领域
- authentication, mobile-dev
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 25/100