Middleware


ActiveUser

If a user is logged in and becomes in active ie an admin changes their account to in-active they will be logged out.

Also these enforce the 2FA pages load when logged in and the 2FA code has not yet been entered, Stopping other pages from loading before approving 2FA.


    
    Route::middleware(['web', 'auth', 'activeUser'])->prefix('admin')->group(function () {
        

IpCheckMiddleware

When IP Lockdown (Office Login) has been enabled the application can only be used from pre-authorised IP addresses. Applying the middleware to routes forces this.

The IP addresses can be set from the System Settings page in the admin.


    
    Route::middleware(['web', 'auth', 'IpCheckMiddleware'])->prefix('admin')->group(function () {
        

Role

Checks if the logged in user has the specified role.


    
    Route::middleware(['web', 'auth', 'role:admin'])->prefix('admin')->group(function () {
        

© 2022 AdminTW. All rights reserved.

Built by David Carr