v1.5.24b - Fixed package.json with new npm
Added comments in middleware
This commit is contained in:
@@ -25,13 +25,16 @@ class CheckAuth
|
||||
/** @var User $user */
|
||||
$user = Auth::user();
|
||||
|
||||
// If user is not logged in - Go to login page
|
||||
if(!isset($user))
|
||||
return redirect()->route("users.login");
|
||||
|
||||
// If the user has the correct permission - Then go to the correct page
|
||||
if($user->hasAnyPermission($permissions)) {
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
return redirect()->route("users.login");
|
||||
// If the user does not have the correct permission - Send them to home page
|
||||
return redirect()->route("root.index");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user