Firebaseauth.js

const firebase = require( "firebase"); firebase.initializeApp({ apiKey: "AIzaSyB9gI97-0qrjMrgElldIuCQF8sWDGO1SBA", authDomain: "treemagazin.firebaseapp.com", projectId: "treemagazin", storageBucket: "treemagazin.appspot.com", messagingSenderId: "481590800298", appId: "1:481590800298:web:f19cb71d655d8b57e305d3", measurementId: "G-EKVM7YN0RX" }) // firebase.auth().createUserWithEmailAndPassword("joelarraez214@gmail.com", "passwords") // .then((userCredential) => { // // Signed in // var user = userCredential.user; // // ... // console.log(user) // }) // .catch((error) => { // var errorCode = error.code; // var errorMessage = error.message; // // .. // }); firebase.auth().signInWithEmailAndPassword("joelarraez214@gmail.com", "passwords") .then((userCredential) => { // Signed in var user = userCredential.user; console.log(user.uid) console.log(user.email) console.log(user.emailVerified) // ... }) .catch((error) => { var errorCode = error.code; var errorMessage = error.message; console.log(errorCode,"---", errorMessage) });
Ejemplo de autenticación de firebase con nodejs

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.