firebase - 如何重新验证 Google 登录用户?
问题描述
我正在为网络开发,并且可以选择让我的用户使用 Google 登录。我希望他们能够删除他们自己的帐户并重置他们的密码,所以我需要重新对他们进行身份验证。
我目前的解决方案是使用 firebase.auth().signInWithRedirect(provider); 然后 firebase.auth().getRedirectResult() 获取 user.reauthenticateWithCredential(credential) 的凭据。这样做的问题是,如果他们选择了错误的帐户,那么他们最终会在我的网站上创建一个新帐户。
我可以使用 Google Sign-In SDK 看到某种针对 android 的解决方案,但重新进行身份验证似乎很多。那是我唯一的选择吗?没有其他方法可以重新验证当前登录的用户吗?
谢谢!
解决方案
在文档中查找错误的位置。
reauthenticateWithRedirect 存在于此处: https ://firebase.google.com/docs/reference/js/firebase.User#reauthenticatewithpopup
推荐阅读
- google-chrome - 检测 Google Chrome 实时字幕
- python - 如何理解 py-spy 的分析报告?
- jwt - Quarkus:集成测试 - 如何模拟 OIDC?
- angular - RROR 错误:找不到带有路径的控件:formArray
- python - 如何使用 python 或 pyspark 获取带有年份的周数列表(此格式为 202114)
- discord.js - 错误提供的选项不是对象。在 Message.delete
- html - 页面转向 http 而不是 https 并且不加载导航栏
- sql - 用于 SQL 查询的弹性搜索查询
- java - 从 int[] 到 int 的不兼容转换
- javascript - 我怎样才能让我的 Discord 机器人在被提及时识别它?