firebase admin SDK create user and send verification email

前端 未结 4 1822
不思量自难忘°
不思量自难忘° 2020-12-05 11:52

How can I send a verification email after I create a user with firebase admin SDK? I am trying to combine createUser function and sendEmailVerification function could somebo

4条回答
  •  再見小時候
    2020-12-05 12:17

    OK this is what you can do but you may hit quota limitations:

    • Include the firebase-admin module.
    • Include the firebase client module.
    • using admin sdk, create the new user via createUser
    • when that promise resolves, get the uid of the user created.
    • using admin sdk, create custom token for that uid.
    • using client sdk, signInWithCustom token using that custom token.
    • A user is returned in the process, call user.sendEmailVerification()
    • signOut that user from the client SDK.

提交回复
热议问题