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
There are two middlewares that I don't understand fully:
lock.Middleware: Rejects requests from locked users
confirm.Middleware: Ensures users are confirmed or rejects request
These middlewares are meant to be put on authenticated routes (routes where the user must have an account to access).
However, rejecting users from locked or unconfirmed users is already taken care of by the auth events provided by the respective modules Init function:
PreventAuth stops the EventAuth from succeeding when a user is not confirmed
Middleware ensures that a user is confirmed, or else it will intercept the request and send them to the confirm page
l.Events.Before(authboss.EventAuth, l.BeforeAuth)
lock.Middleware
BeforeAuth ensures the account is not locked.
Middleware ensures that a user is not locked, or else it will intercept the request and send them to the configured LockNotOK page
There seems to be complete overlap between the middlewares and the before auth events. If a route is already protected by authboss.Middleware, are the lock and confirm middlewares even needed? What is the use case for them?
The text was updated successfully, but these errors were encountered:
The only thing these do is allow you to protect non-login endpoints from unconfirmed or locked users. If you don't use this, a locked user that gets a session (or a user who becomes locked during their session for other reasons) can still access pages as an example.
There are two middlewares that I don't understand fully:
These middlewares are meant to be put on authenticated routes (routes where the user must have an account to access).
However, rejecting users from locked or unconfirmed users is already taken care of by the auth events provided by the respective modules Init function:
There seems to be complete overlap between the middlewares and the before auth events. If a route is already protected by
authboss.Middleware
, are the lock and confirm middlewares even needed? What is the use case for them?The text was updated successfully, but these errors were encountered: