Get the logged in user
const currentUser = adamite().auth().currentUser;
const userId = currentUser.id;adamite().auth().onAuthStateChange(currentUser => {
if (currentUser) {
console.log("logged in as " + currentUser.id);
} else {
console.log("not logged in");
}
});const unsubscribe = adamite().auth().onAuthStateChange(currentUser => {
// ...
});
unsubscribe();Last updated
Was this helpful?