【发布时间】:2022-08-06 03:10:39
【问题描述】:
在我的反应网络应用程序中,有时它不会从用户配置文件中加载图像。我正在使用反应。 它通常有效,但有时无效。
这是浏览器显示的错误:
Failed to load resource: the server responded with a status of 403 ()
这是我的代码:
async function singIngWithGoogle(){
const provider = new firebase.auth.GoogleAuthProvider();
const loginResult = await auth.signInWithPopup(provider);
if(loginResult.user){
const { displayName, photoURL, uid, email } = loginResult.user;
if( !displayName || !photoURL ){
throw new Error(\'Seu usuário Google não possui nome ou foto.\');
}
setUser({
id: uid,
name: displayName,
avatar: photoURL ?? {noUserImg},
userEmail: email ?? \'\'
})
}
}
标签: reactjs typescript