如何获得oobCode本地化的目的 [英] How to get oobCode for localization purpose

查看:188
本文介绍了如何获得oobCode本地化的目的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Firebase只允许一种语言用于确认电子邮件。对于多语言应用程序来说,完美的完成产品是无用的。我想做出我自己的确认系统。唯一的问题是如何获得这个在firebase中生成的oobCode。 site.com?mode=&oobCode =



谢谢。

解决方案

目前无法通过Firebase身份验证API生成有效的 oobCode 值。它只能被发送(如你所说的不可翻译的)电子邮件。

但是你可以建立自己的电子邮件验证机制,如果你想,使用您自己的确认码来验证电子邮件所有权。您可以:


  1. 在服务器上生成一个随机的,不可猜测的代码
  2. 用户的电子邮件地址,然后

  3. 当用户单击确认链接时,在您回叫的同一台服务器上拥有自己的终点。您可以使用Firebase Admin SDK将 emailVerified 属性设置为 true

有关最后一步的示例,请参阅: https://firebase.google.com/docs/auth/admin/manage-users#update_a_user



感谢@Nikhil的评论:或者你可以自己完成验证,并使用Admin SDK将 emailVerified 设置为true。有关这方面的例子,请参阅 Firebase文档。 p>

Firebase allows only one language for confirmations emails. Whole nicely done products are useless for multi-language apps. I want to make my own confirmation system. The only question is how can I get this oobCode which is generated inside firebase. site.com?mode=&oobCode=

Thank you.

解决方案

There is currently no way to generate a valid oobCode value through the Firebase Authentication API. It can only be sent in the (as you've said "non-translatable") email message.

But you can build your own email verification mechanism if you want, using your own confirmation code to verify email ownership. You'd:

  1. Generate a random, unguessable code on a server
  2. Send it to the user's email address and then
  3. When the user clicks the confirmation link, have your own end point on the same server that you call back to
  4. At this point you can use the Firebase Admin SDK to set the emailVerified property to true.

For an example of the last step, see: https://firebase.google.com/docs/auth/admin/manage-users#update_a_user

Thanks to @Nikhil in the comments: Alternatively you can roll your own verification altogether and use the Admin SDK to set emailVerified to true. See the Firebase documentation for an example of that.

这篇关于如何获得oobCode本地化的目的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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