-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: include user.id on session #180
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added my suggestions.
Thank you! @balazsorban44 , great to have a review from you. |
Co-authored-by: Balázs Orbán <[email protected]>
Hey @balazsorban44 nice to see you here! |
Co-authored-by: Balázs Orbán <[email protected]>
Co-authored-by: Balázs Orbán <[email protected]>
Have made the changes suggested by @balazsorban44 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, I'm fine with the session binding being "incorrect" if you don't use a DB persistence (can't imagine many if any of our users would NOT use a DB)
I think modifying the installer to have two separate api-handlers would be better? Also not include the next-auth.d.ts if no db is included? |
Hey @juliusmarminge @theobr, I've made the suggested changes and the PR already has 2 approvals. |
* chore: include user.id on session * chore: include next-auth.d.ts only for next-auth scaffoldings * Update template/addons/next-auth/api-handler-prisma.ts Co-authored-by: Balázs Orbán <[email protected]> * Update template/addons/next-auth/api-handler.ts Co-authored-by: Balázs Orbán <[email protected]> * Update template/addons/next-auth/next-auth.d.ts Co-authored-by: Balázs Orbán <[email protected]> * fix: include `next-auth.d.ts` in `tsconfig.json` * fix: run prettier * chore: make `user` and `id` optional for better type-safety * fix: add `id` to `session.user` only when it exists Co-authored-by: Balázs Orbán <[email protected]>
Include
user.id
on sessionSummary
fixes #176
api-handler-prisma.ts
andapi-handler.ts
next-auth.d.ts
only when it is anext-auth
scaffolding