firebase get current user javascript 1

firebase get current user javascript

var user = firebase.auth().currentUser;

if (user) {
  // User is signed in.
} else {
  // No user is signed in.
}

Here is what the above code is Doing:
1. We’re creating a variable called user and setting it equal to the current user.
2. We’re checking if the user is signed in. If they are, we’ll do something. If they aren’t, we’ll do something else.

Similar Posts