How to get oobCode for localization purpose

冷暖自知 提交于 2020-01-01 14:34:33

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/41515432/how-to-get-oobcode-for-localization-purpose

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!