35
loading...
This website collects cookies to deliver better user experience
NOTE: This blog post assumes that you are at-least familiar with setting up firebase SDK
If you don't I'd recommend reading my blog on firebase firestore first
authentication !== authorization
Authentication: Principal
Authorization: Security Guard
firebase.auth().createUserWithEmailAndPassword(
email,
password
);
NOTE: You Receive a Promise from any Function from Firebase
firebase.auth().signOut()
NOTE: Firebase removes the token stored on the client's localStorage (indexdb to be precise). It'll talk about it in detail in Authorization
firebase.auth().signInWithEmailAndPassword(
email,
password
)
// sends a pre-templated message to a specified email address
firebase.auth().sendEmailVerification(
email,
);
firebase.auth().sendPasswordResetEmail(
email
);
firebase.auth().onAuthStateChanged((user) => {
if (user) {
// User is signed in, see docs for a list of available properties
// https://firebase.google.com/docs/reference/js/firebase.User
var uid = user.uid;
}
});