Add high level wrappers for the most common use cases and frameworks #1345
DmitryScaletta
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In some cases people expect from an auth library some very opinionated decisions.
And sometimes they want very precise and low level of control.
I suggest to add wrappers for the most common use cases for different framework providers.
Basically just get the code from the docs/examples and create very simple and opinionated wrappers that handle:
I think it would be really helpful especially for small projects.
And if they need more precise control later, it's still possible to just use plain lucia v3 functions like before.
These wrappers can be added to a different package for example like
@lucia-auth/wrappers
or@lucia-auth/wrapper-express
.Of course it doesn't solve all problems like login throttling for example and won't fit to every use case.
A big warning about it can be added in the docs.
Examples how it may look like
Express
Next.js App Router
app/login/github/route.ts
app/login/github/callback/route.ts
And also
validateRequest
function like in the docs.Beta Was this translation helpful? Give feedback.
All reactions