Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

199
Vistas
Firebase -- Cannot update user name when user is signin

I cannot update user name where user is sign in to website it doesnt addit to user account, on displaName it shows null.The user account is created succefully but without user name as i said

const onSubmit = async ({ name, email, password }) => {
    setIsLoading(true);
    try {
      await signup(email, password);
      await updateProfile(currentUser, {
        displayName: name,
      });

      setInterval(() => {
        <Redirect to="/" />;
      }, 5000);
    } catch (error) {
      setIsLoading(false);
      console.log(error);
    }
  };
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can use .then().

       firebase
            .auth()
            .createUserWithEmailAndPassword(email, password)
            .then(() => {
                // do whatever in here
                setUserInfo()
                sendEmailVerification()
                setDisplayName()
                alert('Account created!')
            })
            .catch(error => {
                console.log(error)
                alert(error.message)
            })

Inside the setDisplayName(), you can set the displayName. In my case, I am using the firstName and lastName, which I am getting through my form.

const setDisplayName = () => {
        firebase
            .auth()
            .currentUser
            .updateProfile({
                displayName: firstName + ' ' + lastName
            })
            .then(() => {
                console.log('display name set')
            })
            .catch(error => {
                console.log(error)
                alert(error.message)
            })
    }
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda