Guest User

Untitled

a guest
Feb 13th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. const inputEmail = document.getElementById('inputEmail');
  2. const inputPassword = document.getElementById('inputPassword');
  3. const btnIniciarSesion = document.getElementById('btnIniciarSesion');
  4.  
  5. btnIniciarSesion.addEventListener('click', e => {
  6. const email = inputEmail.value;
  7. const password = inputPassword.value;
  8. const auth = firebase.auth();
  9. const promise = auth.signInWithEmailAndPassword(email, password);
  10. promise.catch(e => console.log(e.message));
  11. });
  12.  
  13. firebase.auth().onAuthStateChanged(user => {
  14. if(user)
  15. {
  16. window.location = 'home.html';
  17. }
  18. });
Add Comment
Please, Sign In to add comment