Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const inputEmail = document.getElementById('inputEmail');
- const inputPassword = document.getElementById('inputPassword');
- const btnIniciarSesion = document.getElementById('btnIniciarSesion');
- btnIniciarSesion.addEventListener('click', e => {
- const email = inputEmail.value;
- const password = inputPassword.value;
- const auth = firebase.auth();
- const promise = auth.signInWithEmailAndPassword(email, password);
- promise.catch(e => console.log(e.message));
- });
- firebase.auth().onAuthStateChanged(user => {
- if(user)
- {
- window.location = 'home.html';
- }
- });
Add Comment
Please, Sign In to add comment