Relative Content

Tag Archive for javascriptnext.jsnext-auth

NextAuth.js Adding more data to session

I have an callback inside my next auth api for session in which I’m getting user data from database, which works fine, but the session is called multiple times when the user is browsing the website, so it is overflowing the database. So I want to somehow modify the session, so it doesn’t have to call the database every time, but store the user data in the session itself, either store the user data when signed in or first time the session is called, but I am unsuccessful so far.