Do we still need middleware? #25
|
Does this snippet imply I don't need to use middleware for auth with with local strategy enabled? |
Answered by
CrawlerCode
Apr 7, 2025
Replies: 2 comments 2 replies
|
I am asking with relation to |
1 reply
|
No, this does not imply that you do not need to use middleware. The local strategy is a Payload CMS feature and is absolutely unrelated to Auth.js. General, you don't need the middlware, using it is optional. Auth.js offers you various options and you can configure it according to your requirements, depending on your use case. The benefit of the middleware are:
If you don't want to do this, you don't need middlware. |
1 reply
Answer selected by
CrawlerCode
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No, this does not imply that you do not need to use middleware. The local strategy is a Payload CMS feature and is absolutely unrelated to Auth.js.
enableLocalStrategy: trueonly allows you to combine both strategies.General, you don't need the middlware, using it is optional. Auth.js offers you various options and you can configure it according to your requirements, depending on your use case.
The benefit of the middleware are:
authorizedcallback)If you don't want to do this, you don't need middlware.