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

251
Vistas
How to properly update user information in firebase?

I have a code that is a form, basically is suppose to update the user information. According to Firebase documentation manage user but for some reason I'm getting this errors

enter image description here

This is what I have I don't think I'm missing anything is pretty much the same The only difference is that on my firebase.js I made new cons to make codes shorter but that shouldn't affect at all.

firebase.js

const db = firebase.firestore();
const auth = firebase.auth();
const storage = firebase.storage();

export {db, auth, storage};

Code

import {auth} from "./firebase"

const authUser = auth.currentUser
    const update = (e) => {
        e.preventDefault();
        authUser.updateProfile({
                displayName: {fullName}
        })
    }

I just wanted to test it on the user name first and then do all the others but I don't understand why is not working is super simple.

Update

enter image description here

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

authUser is undefined. This means that auth.currentUser was undefined at the time when it was assigned to authUser. This probably means that the user is not logged in. You will need to handle the case when the user is not logged in, like

import {auth} from "./firebase"

const authUser = auth.currentUser
    const update = (e) => {
        e.preventDefault();
        
        if (authUser) {
            authUser.updateProfile({
                displayName: fullName
            })
        } else {
            //User is not logged in, handle that case here
        }
    }
about 4 years ago · Juan Pablo Isaza Denunciar

0

import {auth} from "./firebase";
const authUser = auth.currentUser;
const update = (e) => {
    e.preventDefault();
    authUser?.updateProfile({
        displayName: fullName
    });
}
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