I'm using Firebase (angularfire) and Facebook login in my APP to authenticate my users. However today I realized that the profile image URL had been expired, but the Firebase SDK isn't refreshing it.
Is there a way to solve this or should I request the image using the Facebook API?
I solved this by using the photoURL that can be found within: user.providerData[0].photoURL
Where user
is the user data returned on
firebase.auth().onAuthStateChanged( user => {})
And [0]
is the index of the Authentication Provider of interest. In my case I only have Facebook authentication, thus the index is 0.
Seems that this URL is somehow being updated... (maybe on user sign in?)
Edit: It seems that the URL is indeed being updated on user sign in. So be aware that if the user is "remembered" by the browser, with this method the image will eventually expire, if the user isn't forced to sign in again before expiration.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With