Skip to content

fix(ts): revert session callback type changes#7136

Merged
balazsorban44 merged 1 commit intonextauthjs:v4from
juliusmarminge:patch-1
Apr 3, 2023
Merged

fix(ts): revert session callback type changes#7136
balazsorban44 merged 1 commit intonextauthjs:v4from
juliusmarminge:patch-1

Conversation

@juliusmarminge
Copy link
Copy Markdown
Contributor

@juliusmarminge juliusmarminge commented Apr 3, 2023

Closes #7132
Fixes t3-oss/create-t3-app#1328

Seems like #7056 changed this type which breaks module augmentation.

NOTE:

  • It's a good idea to open an issue first to discuss potential changes.
  • Please make sure that you are NOT opening a PR to fix a potential security vulnerability. Instead, please follow the Security guidelines to disclose the issue to us confidentially.

☕️ Reasoning

🧢 Checklist

  • Documentation
  • Tests
  • Ready to be merged

🎫 Affected issues

Please scout and link issues that might be solved by this PR.

Fixes: INSERT_ISSUE_LINK_HERE

📌 Resources

@juliusmarminge juliusmarminge requested a review from 0ubbe as a code owner April 3, 2023 06:53
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 3, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
next-auth-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 3, 2023 6:53am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
auth-docs ⬜️ Ignored (Inspect) Apr 3, 2023 6:53am

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 3, 2023

@juliusmarminge is attempting to deploy a commit to the authjs Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added core Refers to `@auth/core` TypeScript Issues relating to TypeScript labels Apr 3, 2023
@juliusmarminge juliusmarminge changed the title Update types.ts fix: wrong types breaks module augmentation Apr 3, 2023
@balazsorban44
Copy link
Copy Markdown
Member

See #7132 (comment), happy to discuss on that issue if we should revert or keep it, not sure. 🙏

Copy link
Copy Markdown
Member

@balazsorban44 balazsorban44 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Based on the discussion, this is fair!

@balazsorban44 balazsorban44 changed the title fix: wrong types breaks module augmentation fix(ts): revert session callback type changes Apr 3, 2023
@balazsorban44 balazsorban44 merged commit ec8a343 into nextauthjs:v4 Apr 3, 2023
@LegendNihal
Copy link
Copy Markdown

LegendNihal commented Jan 14, 2024

I found the main problem here. When you hover over user on the right side one session.user.id = user.id; you can see user is adapterUser which is only available if strategy is set to database. Since we are using Prisma and Prisma doesn't run on Edge runtime, we had to set strategy to jwt. Thats why user.id is null.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Refers to `@auth/core` TypeScript Issues relating to TypeScript

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants