+ 1

How to use firebase request like Promises ? (Javascript)

All is in the question.

19th Jun 2018, 6:51 AM
Αητοιπe
Αητοιπe - avatar
2 ответов
+ 1
firebase.auth().signInWithEmailAndPassword(email, password).then(function(user) { // user signed in }).catch(function(error) { var errorCode = error.code; var errorMessage = error.message; if (errorCode === 'auth/wrong-password') { alert('Wrong password.'); } else { alert(errorMessage); } console.log(error); }); Basically this is promise which is handled in catch easily.
19th Jun 2018, 6:31 PM
ᴋᵘⁿᵃˡ
ᴋᵘⁿᵃˡ - avatar
+ 1
19th Jun 2018, 9:26 PM
Αητοιπe
Αητοιπe - avatar