-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
feat(prisma-adaper): update PrismaAdapter
options to accept optional custom model names
#12401
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
@ogroppo is attempting to deploy a commit to the authjs Team on Vercel. A member of the Team first needs to authorize it. |
packages/adapter-prisma/src/index.ts
Outdated
authenticatorModel?: string; | ||
sessionModel?: string; | ||
userModel?: string; | ||
verificationTokenModel?: 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.
just allow users to override the model name
PrismaAdapter
to accept dynamic model namesPrismaAdapter
options to accept optional custom model names
packages/adapter-prisma/src/index.ts
Outdated
const accountModel = p[options?.accountModel ?? "account"]; | ||
const authenticatorModel = p[options?.authenticatorModel ?? "authenticator"]; | ||
const sessionModel = p[options?.sessionModel ?? "session"]; | ||
const userModel = p[options?.userModel ?? "user"]; |
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.
Looks like there's some TS issues here. See: https://github.com/nextauthjs/next-auth/actions/runs/12449775424/job/34755845781?pr=12401
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.
☕️ Reasoning
If there are more tables with the same name e.g.
User
there is no way to work around it.This is super typical if there are 2 auth systems in the same DB example platform users and admin users...
🧢 Checklist
📌 Resources