Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

signInWithCredential get stuck

未关闭
#3,646 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
angular, firebase, typescript

调研方向

从 auth.service.ts 中的 loginWithGoogle 方法开始,使用所列出的 Angular、Firebase、Ionic 和 Capacitor 版本复现原生路径。比较 SocialLogin.login、GoogleAuthProvider.credential 和 signInWithCredential 附近的行为,并验证设备不再无响应,且失败会产生错误。

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
TypeScript
星标
7.8k
派生
2.2k
平均合并
3 天 6 小时
30 天内合并 PR
5

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

angular/angularfire 的其他 Issue

查看 angular/angularfire 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。