Я создаю страницу регистрации / входа.
При первой регистрации пользователя, x@x.com, все в порядке.
Затем я пытаюсь выйти из системы и войти, все идет как надо.
Но, как только я обновлю sh страницу, я больше не могу войти. Мне показалось, что я удалил всех своих пользователей, поэтому попытался создать того же пользователя снова (x@x.com), но получил> «auth / email-Уже используется». Но после этой попытки я мог войти с x@x.com.
function signIn() {
var email = document.getElementById("emailin").value
console.log(email)
var pass = document.getElementById("pass").value
firebase.auth().signInWithEmailAndPassword(email, pass).then(function () {
console.log("adentro")
email.value = ""
pass.value = ""
}).catch(function (error) {
// Handle Errors here.
var errorCode = error.code;
var errorMessage = error.message;
console.log(errorCode + errorMessage)
});
}
function signUp() {
var email = document.getElementById("email").value
console.log(email)
var email2 = document.getElementById("email2").value
var pass = document.getElementById("pass").value
if (email === email2 && pass != "") {
firebase.auth().createUserWithEmailAndPassword(email, pass).catch(function (error) {
// Handle Errors here.
var errorCode = error.code;
var errorMessage = error.message;
console.log(errorCode + errorMessage)
});
}
}
function signOut() {
console.log("signOut")
firebase.auth().signOut().then(function () {
// Sign-out successful.
}).catch(function (error) {
// An error happened.
});
}
Есть идеи? Спасибо!