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

160
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 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