angular / angular/angularfire

signInWithCredential get stuck

Đang mở
#3,646 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
7.8k
Fork
2.2k
Merge trung bình
22 giờ 28 phút
Pull request đã merge (30 ngày)
6

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu từ phương thức loginWithGoogle trong auth.service.ts và tái hiện luồng native bằng các phiên bản Angular, Firebase, Ionic và Capacitor được liệt kê. So sánh hành vi xung quanh SocialLogin.login, GoogleAuthProvider.credential và signInWithCredential, đồng thời xác minh rằng thiết bị không còn bị treo và các lỗi tạo ra một error.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
angular, firebase, typescript
Lĩnh vực
authentication, mobile-dev
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.