Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

122
Visualizações
How to set username in Firebase auth

Hello how can I set username on Signup for Firebase User. I use firebase Authentication API. I thought about try / catch block and setting User properties like

const user = auth.currentUser;
user.name = 'John123'

Is it possible?

const onSubmitHandler = (e: React.FormEvent<HTMLFormElement>) => {
        e.preventDefault()
        createUserWithEmailAndPassword(auth, email, password)
        
        
    }
about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

Firebase Authentication has a display name for each user, which can be whatever you want it to be. To set it, call updateProfile as shown in the documentation on updating the user's profile:

await createUserWithEmailAndPassword(auth, email, password);
updateProfile(auth.currentUser, {
  displayName: "John123"
})
about 4 years ago · Juan Pablo Isaza Relatório

0

It is full solution

 const onSubmitHandler = (e: React.FormEvent<HTMLFormElement>) => {
        e.preventDefault()
        const createUser = async ( ) => {
            await createUserWithEmailAndPassword(auth, email, password)
            updateProfile(auth.currentUser!, {
            displayName: "John123" // it can be a value of an input
          })
        }
        createUser()
    }
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda