Send User Password via Email with Firebase

主宰稳场 提交于 2019-12-23 02:32:48

问题


I am creating a android application where I'm using firebase auth but I don't want to send the confirmation email to user for confirming the user email address, instead I want to set a auto generated password for the user and send it to the users email so by that way I can verify his email.

Just wanted to know if it is possible or not, if yes then link to any guide or tutorial will be great.

Thanks


回答1:


Yes, it is possible. When user creates his account send a auto generated password on his email and also in realtime database or firestore create a field status corresponding to users Uid and set default value to false. Also save that auto generated code in database. When user tries to login for the first time (check if status is false) then open a dialog and ask for the code send on email. if both code matches email verified change status to true else gives message incorrect code.

When the user login for the first time ask his email and password. Then verify it in auth module. If user exists then retrieve his data from realtime database and check if value of status is false or true. If value is false this means he is logging for the first time. So, open either a activity or a dialog which asks his code send on email. Then check if both code matches. If yes then this is the correct user. Send him to home activity and set the value of status to true in database.



来源:https://stackoverflow.com/questions/51051655/send-user-password-via-email-with-firebase

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