daily pastebin goal
51%
SHARE
TWEET

Untitled

a guest Feb 13th, 2018 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. });
RAW Paste Data
Top