Skip to content
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

[Bug]: createSession is sending malformed database fields to DB #1372

Closed
singhofmarco opened this issue Jan 28, 2024 · 2 comments
Closed

[Bug]: createSession is sending malformed database fields to DB #1372

singhofmarco opened this issue Jan 28, 2024 · 2 comments
Labels
bug Something ain't right...

Comments

@singhofmarco
Copy link

singhofmarco commented Jan 28, 2024

Package

lucia

Describe the bug

I'm using prisma 3.0.1 and prisma-adapter 4.0.0, createSession throws a Prisma exception. It seems like it's ignoring the db fields and tries to send camelCased fields to prisma instead:

PrismaClientValidationError: 
Invalid `prisma.session.create()` invocation:

{
  data: {
    id: "znhqg0v3dmu6qjm6p5f51uv6s6tpvimovujx5ftw",
    userId: "samytgqj90l306j",
    expiresAt: new Date("2024-02-27T10:49:22.394Z"),
+   expires_at: DateTime
  }
}
@singhofmarco singhofmarco added the bug Something ain't right... label Jan 28, 2024
@pilcrowonpaper
Copy link
Member

No this is expected. The Prisma adapter uses camel case instead of snake cases with v3 to be consistent with Prisma.

https://lucia-auth.com/upgrade-v3/prisma/

@pilcrowonpaper pilcrowonpaper closed this as not planned Won't fix, can't repro, duplicate, stale Jan 28, 2024
@singhofmarco
Copy link
Author

I see, I had forgotten to update my schema... Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something ain't right...
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants