Cloud Functions for Firebase - action on email verified

后端 未结 3 2218
滥情空心
滥情空心 2020-12-01 07:35

Im trying to create a Cloud Function trigger that will execute after email has been verified.

In the Cloud Functions samples I could only find examples on triggers f

3条回答
  •  余生分开走
    2020-12-01 08:02

    Create a publish button so your users trigger your cloud function

    Instead of firing the cloud function immediately upon auth.emailVerified, I'm giving my users a 'Publish Profile' button which fires an http cloud function (passing in user.uid). This function looks up the user auth using the passed in user.uid

    if user.uid && auth.emailVerified

    write auth.emailVerified to each user.post

    By default, post document "post.emailVerified" fields start out false, and cannot be written to except via adminFirestore in a cloud function.

提交回复
热议问题