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

后端 未结 3 1781
余生分开走
余生分开走 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:16

    You can make sure whether the user clicked on the verification link by trying to get the user id for the current user from Firebase, when it's empty, then this means that the user clicked on verification link and a new user has been created.

    FirebaseAuth mAuth = FirebaseAuth.getInstance();
    if(!mAuth.getCurrentUser().getUid().equals("")){
    // the user clicked on the verification link.
    // a new user has been created.
    }
    else{
    // the user didn't click on the verification link.
    // No user created.
    }
    

提交回复
热议问题