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

159
Visualizações
How do I add more fields in firebase-auth?

After a long research on firebase-auth with email and password, I found that we can't give more than two fields (email and password).
In my assignment, they supposed to give three input fields (full name, email and password).
I have completed my assignment only with two input fileds (email and password) but they also want to store full-name in firebase.
My assignment is given bellow -
enter image description here

So, Is it possible to also store "full name" in firebase, If so then how ?
I could describe this question in another way, but I just tell you the truth.
Please Help Me !

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

You have basicaly two options for doing that:

  1. as mentioned in the comments you could use the database to store additional data for each user uid
  2. use customClaims to store such additional data there

I would recommend the first one for more data if you need to store a lot of data and if you have less you could use the customClaims. They are limited in size so be carefull how much you save inside.

about 4 years ago · Juan Pablo Isaza Relatório

0

Firebase Auth object has a displayName property which you use to store user's name. However, if you are using Client SDK then you would have to create the user first and then update the name. This can be done in a single step if you use Admin SDK with Cloud functions or a server.

import { useAuth } from "firebase/auth"

const auth = getAuth();

const createNewUser = async () => {
  const { user } = await createUserWithEmailAndPassword(auth, email, password)
  await updateProfile(user, { displayName: "Jane Q. User" })
  console.log('New user', user.uid)
}

If the full name consists of a first name and a last name, then you can add a - or any symbol between them e.g. first-last in displayName. Then you can read the name as shown below:

const { displayName } = auth.currentUser
const [firstName, lastName] = displayName.split("-")

If you need to access the data from a server environment or any user management page, then it'll be best to store details of users in a database answered by @TarikHuber.

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