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

119
Visualizações
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 à 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