v1.5.24b - Fixed package.json with new npm

Added comments in middleware
This commit is contained in:
Anders
2021-05-20 08:42:09 +02:00
parent 20fe7dbcee
commit 3465e30c8f
11 changed files with 8740 additions and 8076 deletions
+4 -1
View File
@@ -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");
}
}