Skip to content
This repository has been archived by the owner on Sep 27, 2019. It is now read-only.

Commit

Permalink
Alterado o método de redirecionamento;
Browse files Browse the repository at this point in the history
Agora não salva o histórico ao ser redicionado para o login ou para a autenticação.
  • Loading branch information
raulfdm committed Oct 16, 2016
1 parent 993ee80 commit fc3e903
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/js/app-es6/boot.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ firebase.auth().onAuthStateChanged(function(user) {
$('.dropdown-button').dropdown();

} else {
window.location.href = "/autenticar.html";
window.location.replace("/autenticar.html");
}
});
15 changes: 6 additions & 9 deletions src/js/config/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ btnCadastroUser.addEventListener('click', function () {
firebase
.auth()
.createUserWithEmailAndPassword(emailInput.value, passwordInput.value)
.then(function (resultado) {
//console.log(resultado);
.then(function (resultado) {
alert('sucesso!');
window.location.replace("/");
})
.catch(function (error) {
//console.log(error.code, error.message);
.catch(function (error) {
alert('fail!');
})
});
Expand All @@ -25,12 +24,10 @@ btnLoginUser.addEventListener('click', function () {
firebase
.auth()
.signInWithEmailAndPassword(emailInput.value, passwordInput.value)
.then(function (resultado) {
//console.log(resultado);
window.location.href = "/"
.then(function (resultado) {
window.location.replace("/");
})
.catch(function (error) {
//console.log(error.code, error.message);
.catch(function (error) {
alert('fail!');
})
});

0 comments on commit fc3e903

Please sign in to comment.