Is there a way to know that a user clicked on the verification link?

后端 未结 3 1779
余生分开走
余生分开走 2021-02-09 20:55

Here\'s the code I\'m using to send a verification email (taken from the official docs)

var user = firebase.auth().currentUser;

user.sendEmailVerification().the         


        
3条回答
  •  走了就别回头了
    2021-02-09 21:23

    You can add a continueUrl when sending an email verification to redirect back to your app: https://firebase.google.com/docs/auth/web/passing-state-in-email-actions

    var actionCodeSettings = {
      url: 'https://www.example.com/?email=' + 
           firebase.auth().currentUser.email
    };
    firebase.auth().currentUser.sendEmailVerification(actionCodeSettings)
      .then(function() {
        // Verification email sent.
      });
    

    This will show a continue button after verification. You can use it to go back to the app or to some page where you can notify the original page via real time database of the verification.

提交回复
热议问题