Do we still need middleware? #25
-
Does this snippet imply I don't need to use middleware for auth with with local strategy enabled?
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
I am asking with relation to |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
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: true
only 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:
authorized
callback)If you don't want to do this, you don't need middlware.