-
-
Notifications
You must be signed in to change notification settings - Fork 319
Add middleware system #3686
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Add middleware system #3686
Conversation
| return; | ||
| } | ||
|
|
||
| Redirect::to(URL::build('/maintenance')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should not send users to maintenance page thats just annoying, And alot of users like just to refresh site to see if maintenance is complete
Also makes uses lose any details they might have in the URL
| public array $exemptRoutes = [ | ||
| '/user/connections', | ||
| '/oauth', | ||
| '/user/settings', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
User should only be able to view /user/settings IF they are viewing enable_tfa
| return; | ||
| } | ||
|
|
||
| // Skip if AJAX request, such as Alert or PM checks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was well also to prevent the code from refreshing when user switch to next step as that refreshing the site
| { | ||
| public array $exemptRoutes = [ | ||
| '/logout', | ||
| '/user/settings' // Allow access to settings to enable TFA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, ONLY allow enable_tfa section,
Now user details is exposed can can be modifyed and can even disable 2fa without using 2fa to login
|
Able to make modules add/modify exemptRoutes? |
Introduces middleware system. I've implemented it in a few areas which are loaded globally and on the frontend which do redirects based on user/site state (maintenance mode, force TFA, etc). This helps us remove some global procedural code as we try to get to a cleaner internal state.