Flutter-在Firebase中注册后删除自动登录 [英] Flutter - remove auto login after registration in Firebase

查看:45
本文介绍了Flutter-在Firebase中注册后删除自动登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Flutter中注册时遇到了问题.据我所知,firebase注册后会自动登录用户.我要阻止此操作,因为必须在我的应用中确认每个用户.

I've got a problem with registration in Flutter. As far as I see, firebase sign in user automatically after registration. I want to prevent this action, because in my app every user must be confirmed.

除了IMO,我在其他主题中也看到了这种情况的解决方案,在注册后调用注销不是一个好主意,因为我们需要执行其他步骤.注册后有没有可能以更漂亮的方式删除登录名?

I saw the solution for this case in other topic but IMO, calling signout after registration isn't good idea because we need to do additional step. Is there any possibility to remove sign in after registration in prettier way?

谢谢!

推荐答案

从客户端Firebase身份验证SDK创建帐户会自动将该用户登录.

Creating an account from the client-side Firebase Authentication SDKs automatically signs that user in. There is no way to prevent this.

另请参阅:

如果您要在用户确认其电子邮件地址之前阻止其使用该应用程序,那就是授权问题.

If you want to prevent a user from using the application until they've confirmed their email address, that is an authorization question.

这里的方法分为两步:

  1. 在您的应用程序代码中,检查他们是否已验证其电子邮件地址,并仅将其重定向到主屏幕.
  2. 在任何服务器端代码中,您都对ID令牌进行解码,并检查电子邮件地址是否已验证.
查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆