0

I have got a login page where after entering the email and password, user gets signed in, after logging in, there is a page that allows new users to be created, now if I create any user, it gets registered successfully but the newly created user automatically takes place of the currently signed in user.

Here is my code:

var teamMateEmail = $('#teamMateEmail').val();
var teamMatePassword = $('#teamMatePassword').val();

auth.createUserWithEmailAndPassword(teamMateEmail, teamMatePassword).then(function() {
    console.log('User created!');
}).catch(function(error) {
    // Handle Errors here.
    var errorCode = error.code;
    var errorMessage = error.message;
});

The above code logs 'User created' once a user has been created but then takes over the signed in user, I want to stop it, the new user should only be considered as logged in when the user enters his email and password.

The official documentation mentions about auto-login:

If the new account was created, the user is signed in automatically

gegobyte
  • 4,945
  • 10
  • 46
  • 76

0 Answers0