Trato de realizar un login usando firebase, pero me sale un error de consola
"Firebase.auth() is not a function"
Por lo cual no me deja realizar el logueo, de resto todo el código compila y funciona la conexión a firebase
var config = {
apiKey: "AIzaSyB3RD_EJOPuLQXADQGzjhYBQLresq2bqzw",
authDomain: "ecommerce-2d647.firebaseapp.com",
databaseURL: "https://ecommerce-2d647.firebaseio.com",
projectId: "ecommerce-2d647",
storageBucket: "ecommerce-2d647.appspot.com",
messagingSenderId: "949533636518",
appId: "1:949533636518:web:2a1472dede404f8a"
};
// Initialize Firebase
firebase.initializeApp(config);
const txtEmail = document.getElementById('correo');
const txtPassword = document.getElementById('pass');
const btnLogin = document.getElementById('login');
btnLogin.addEventListener('click', e => {
const email = txtEmail.value;
const pass = txtPassword.value;
const auth = firebase.auth();
const promesa = auth.signInWithEmailAndPassword(emails,pass);
promesa.catch(e => location.href = "admin/error.php");
});
firebase.auth().onAuthStateChanged(firebaseUser => {
if (firebaseUser) {
location.href = "admin";
}
});
Además en otro archivo tengo la inclusión a firebase
<script src="https://www.gstatic.com/firebasejs/6.0.2/firebase-app.js"></script>
<script src="js/app.js"></script>