【发布时间】:2019-04-25 20:35:49
【问题描述】:
我目前尝试使用 signInWithRedirect 重构所有 signInWithPopup 方法,因为它在移动设备上更加用户友好。然而,当我尝试在重定向后检索数据时,我永远无法得到它。我什至尝试设置超时。也许你们中的一些人知道我的问题的解决方案: Firebase doc
我的服务
public loginWithGoogle(): Promise<firebase.UserCrendential> {
const provider = new firebase.auth.GoogleAuthProvider();
return this.angularFireAuth.auth.signInWithRedirect(provider).then(() =>
this.angularFireAuth.auth.getRedirectResult().then(res => res));
}
组件
// binded on a click event on the dom - just wanna log the data not more :(
public loginWithGoogle(): void {
this.loginService.loginWithGoogle().then(res => console.log(res))
}
【问题讨论】:
标签: angular firebase firebase-authentication angularfire2