Keep track if the user is new in the session #2367
Unanswered
kettanaito
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey. Thank you for an awesome project!
In my application, I use NextAuth and GitHub login but the user needs to finish a setup step in order for the user record to be created in the database. Until they do, they are treated as a "guest" user, which I store in my token/session:
Question
How do I update
session.user.isNewUser
on runtime from my client-side code?The setup success is a clear event I can determine in my client-side code:
It seems redundant and slow to update
session.user.isNewUser
on eachsession
callback. That value is switched from false to true once, and will not change anymore.What I've done
Related issues
I've read through a bunch of issues but haven't found a suggestion that'd suit my use case:
I've also tried mutating the
session
object in hope to get that mutated value in thesession
callback:There is no way to access the overridden value of
isNewUser
in thesession
callback, it remainstrue
.Beta Was this translation helpful? Give feedback.
All reactions