Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

118
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!