javascript - signInWithEmailAndPassword and EmailAuthProvider -
i trying understand new authentication model. trying convert web code used older authwithpassword.
considering had:
firebase.authwithpassword({email: email, password: password }).then( authdata => console.log('auth: authwithpassword success '+authdata.uid), err => console.log('auth: authwithpassword fail: '+err));
how achieve same thing new version ?
there seem 2 different interfaces:
auth().signinwithemailandpassword
and
firepad.auth.emailauthprovider
but don't understand difference or how use them. there clear example correct way email authentication ?
there lot of such differences new api. best stick closely docs.
the new docs site has guide on email/password authentication, specific question code:
firebase.auth().signinwithemailandpassword(email, password).catch(function(error) { // handle errors here. var errorcode = error.code; var errormessage = error.message; // ... });
Comments
Post a Comment