'Unable to get image from Google User profile
In my react web app, sometimes it doesn't load the image from the user profile. I'm using react. It normally works, but sometimes it doesn't.
Here is the error that browser shows:
Failed to load resource: the server responded with a status of 403 ()
Here is my code:
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 ?? ''
})
}
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

