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

124
Vistas
Adding properties to next auth account when account is created

I'm using Next Auth to handle authentication on my project but I'm having a small issue. When you create a new account by signing in with a social provider like github or twitter, You get an object like this:

    _id:61dc91ff7581802bcba5d3b4
    name:Array
    email:"xxxxxxxxxxx@aol.com"
    image:"xxxxxxxxxxx.jpg"
    emailVerified:null
    __v:1

However because of the nature of the application I need the object to have a few more properties automatically generated when the account is created or it leads to problems where react can't render the page because it is trying to read a property that doesn't exist. For example the app can't render the page when its looking for {session?.watchlists[i].watchlistName}, if watchlists isn't an existing property. This is what I need:

    _id:61dc91ff7581802bcba5d3b4
    name:Array
    email:"xxxxxxxxxx@aol.com"
    image:"xxxxxxxxxx.jpg"
    emailVerified:null
    followers:Array
    following:Array
    watchlists:Array
    __v:1
    status:""

The followers, following, and watchlists can be empty arrays, and status an empty string.

How do I go about adding these empty property fields when an account is created ?

about 4 years ago · Juan Pablo Isaza
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