]> BookStack Code Mirror - bookstack/blobdiff - app/Http/Middleware/Authenticate.php
respective book and chapter structure added.
[bookstack] / app / Http / Middleware / Authenticate.php
index dede8f26056528445d01792d119243025c0ebf0b..6a5c6e3542e0ec80c6f7205b80a48fc12ef2aa50 100644 (file)
@@ -12,10 +12,11 @@ class Authenticate
      */
     public function handle(Request $request, Closure $next)
     {
-        if (!hasAppAccess()) {
+        if (!user()->hasAppAccess()) {
             if ($request->ajax()) {
                 return response('Unauthorized.', 401);
             }
+
             return redirect()->guest(url('/login'));
         }