火力地堡用户获取几天后注销 [英] Firebase user gets logged out after a couple of days

查看:184
本文介绍了火力地堡用户获取几天后注销的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我添加了电子邮件和放大器。然而,我注意到,一段时间过后(也许1,2天) firebase.getAuth()返回null。
请注意,我没有叫 firebase.unauth()在code的任何地方,好像在认证会话一段时间后到期。
有没有一种方法,使会议结束后的几天不会过期的?
我能想到的2解决方案,但似乎都对我不好:

I've added email&password, google, facebook authentication in my application. However, I noticed that after some time passes (1,2 days maybe) firebase.getAuth() returns null. Please note that I haven't called firebase.unauth() anywhere in the code, it seems like the authenticated session expires after some time. Is there a way to make the session not expire after few days? I can think of 2 solutions but both seem bad to me:


  • 存储自定义从谷歌,Facebook(也许加密),电子邮件和放大器OAuthToken;密码组合(最坏情况),并调用 firebase.authWithOAuthToken()连连会话时已成为非法

  • 带给用户返回到登录界面,要求重新进行授权每个会话过期时间。我想是因为它打破了UX和潜在搅得广大用户,这是比上面更差。

  • Store custom OAuthToken from Google, Facebook (maybe encrypted), email&password combo(worst case) and call the firebase.authWithOAuthToken() again and again when the session has become unauthorized
  • Bring the user back to login screen asking to perform the authorization again each time the session expires. I think this is even worse than the above because it breaks the UX and potentially upsets the majority of users.

有一个内置的机制,才达到以上?谢谢!

Is there a built-in mechanism to achive the above? Thanks!

推荐答案

解决方案3号,也是这个问题的原因。在登录和放大器的火力点的仪表板;验证选项卡中可以设置会话长度,默认为24或48小时,我认为。

Solution number 3 and also the cause of this issue. In your firebase dashboard on the Login & Auth tab you can set the session length, default is 24 or 48 hours i think.

所以,如果你把它设置24小时的所有会话会像你现在看到的24小时后到期。但你可以改变这6个月的例子。

So if it's set at 24 hours all sessions will expire after 24 hours like you are seeing right now. But you can change this to 6 months for example.

在这里输入的形象描述

这篇关于火力地堡用户获取几天后注销的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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