-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
fix: TS Module Augmentation #5556
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
I believe events and the signIn callback both can receive the user from the database.
🎉 Experimental release published 📦️ on npm! pnpm add next-auth@0.0.0-pr.5556.ac098ce6 yarn add next-auth@0.0.0-pr.5556.ac098ce6 npm i next-auth@0.0.0-pr.5556.ac098ce6 |
That's true, I matched the type of |
@@ -17,7 +17,7 @@ export interface CredentialsConfig< | |||
authorize: ( | |||
credentials: Record<keyof C, string> | undefined, | |||
req: Pick<RequestInternal, "body" | "query" | "headers" | "method"> | |||
) => Awaitable<(Omit<User, "id"> | { id?: string }) | null> |
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.
@ThangHuuVu We use SERIAL id's as we have a PostgreSQL database coming from v3, the removal of this line triggers a type error as number is not assignable to string.
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.
Do we need to extend the User
interface as well? @emrysal
* commit '462cca1087135ffc89af39f1f4ad6a0007e38f7a': chore(release): bump package version(s) [skip ci] chore: remove codeql run on main push fix(ts): TS Module Augmentation (nextauthjs#5556) docs: options.md grammar fixes (nextauthjs#5562)
☕️ Reasoning
This fixes the Module Augmentation issue:
| { email: string }
part which breaks the Module Augmentation. I don't think we need it for anything 🤔. Matches that type withAdapterUser
instead.🎫 Affected issues
Fixes: #5542
📌 Resources