Replies: 1 comment 1 reply
-
Lucia doesn't support default and database-generated values right now (compatibility issues stemming from adapters). So columns should be |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I just found out about Lucia today and I've already fallen in love with it. I'm currently using the prisma adapter and found that the
attributes
type in theAuth.createUser()
function hasLucia.DatabaseUserAttributes
type which causes an issue. Because of that type I have to pass all of the attributes, even if they are not required to create the user in prisma.Example:
Right now I'm using this workaround:
It works fine with my usecase, but I don't know if the
Lucia.DatabaseUserAttributes
is used somewhere else where making some fields optional would break the type safety, defeating the point of this workaround.The solution:
It is quite easy to get the correct types thanks to the autogenerated types from prisma:
I don't know if it's possible to implement an optional generic type for the auth methods that would benefit from the improved type safety or to change the types to work automagically. I'd like to hear if this idea can be implemented and if not - why?
Like I said, I just started using lucia and maybe I just don't understand something obvious.
Beta Was this translation helpful? Give feedback.
All reactions