firebase admin SDK create user and send verification email

前端 未结 4 1819
不思量自难忘°
不思量自难忘° 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:25

    A rather clean solution would be to actually use the REST APIs.

    curl 'https://www.googleapis.com/identitytoolkit/v3/relyingparty/getOobConfirmationCode?key=[API_KEY]' \
    -H 'Content-Type: application/json' \
    --data-binary '{"requestType":"PASSWORD_RESET","email":"[user@example.com]"}'
    

    The [API KEY] is a web client api key that can be retrieved from Project Settings > add an app >> click web and you will get the configuration with a JSON, within the JSON there is an APIKey that is the one that you need to use.

提交回复
热议问题