You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am migrating from SQLite to Postgres, using Drizzle. When I use the same table structure I get an error in Lucia:
TypeError: date2.getTime is not a function
at isWithinExpirationDate (file:///Users/cliftonc/work/fintune/node_modules/lucia/node_modules/oslo/dist/index.js:34:30)
at Lucia.validateSession (file:///Users/cliftonc/work/fintune/node_modules/lucia/dist/core.js:70:14)
This is because in your postgres adapter you assume the date being returned from postgres is a date:
So my suggestion would be to check if the field is a Date, and if not try to convert it. I've made a small PR but no issue if you would prefer another path.
The text was updated successfully, but these errors were encountered:
Package
lucia
Describe the bug
I am migrating from SQLite to Postgres, using Drizzle. When I use the same table structure I get an error in Lucia:
This is because in your postgres adapter you assume the date being returned from postgres is a date:
The reason this works in your tests is you use the native postgres.js, but Drizzle (for some reason) introduced a breaking change: https://github.com/drizzle-team/drizzle-orm/releases/tag/0.30.0
So my suggestion would be to check if the field is a Date, and if not try to convert it. I've made a small PR but no issue if you would prefer another path.
The text was updated successfully, but these errors were encountered: