问题
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:
- Generate a random, unguessable code on a server
- Send it to the user's email address and then
- When the user clicks the confirmation link, have your own end point on the same server that you call back to
- At this point you can use the Firebase Admin SDK to set the
emailVerified
property totrue
.
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