Firebase Facebook登录照片的网址签名已过期 [英] Firebase facebook login photo url signature expired

查看:937
本文介绍了Firebase Facebook登录照片的网址签名已过期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Firebase(angularfire)和Facebook登录功能对我的用户进行身份验证。但是,今天我意识到配置文件图片网址已过期,但Firebase SDK不会刷新它。

有没有办法解决这个问题,或者我应该使用Facebook API请求图片?

解决方案使用可以在< .photoURL
其中 user 是在

<$ p $上返回的用户数据onAuthStateChanged(user => {})



firebase.auth p>和 [0] 是感兴趣的认证提供者的索引。在我的情况下,我只有Facebook身份验证,因此索引是0.



似乎这个URL以某种方式被更新...(也许在用户登录?)


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?)

这篇关于Firebase Facebook登录照片的网址签名已过期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆