Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase - no displayName for user

I can add users in Firebase console -> Auth but I can't do anything more than setting an email and password for them.

Could I in some way set for them displayName?

like image 305
elzoy Avatar asked Jul 06 '16 14:07

elzoy


People also ask

Can we use Firebase without authentication?

No Firebase Authentication…To use the Firebase Storage we need to authenticate a user via Firebase authentication. The default security rules require users to be authenticated. Firebase Storage is basically a powerful and simple object storage, in which you can store your files easily.

How does Firebase identify a user?

Auth tokensCreated by Firebase when a user signs in to an app. These tokens are signed JWTs that securely identify a user in a Firebase project. These tokens contain basic profile information for a user, including the user's ID string, which is unique to the Firebase project.


1 Answers

I guess if you just want to update users profile:

firebase.auth().onAuthStateChanged(function(user) {
  if (user) {
    // User is signed in.
    user.updateProfile({
        displayName: "Random Name"
    }).then(function() {
        // Update successful.
    }, function(error) {
        // An error happened.
    });

  } else {
    // No user is signed in.
  }
});

Additionally: https://firebase.google.com/docs/auth/web/manage-users

like image 94
Victor Oliveira Antonino Avatar answered Sep 19 '22 11:09

Victor Oliveira Antonino