]> BookStack Code Mirror - bookstack/blobdiff - app/Http/Middleware/Authenticate.php
Fixed failing test after drawio default url change
[bookstack] / app / Http / Middleware / Authenticate.php
index c687c75a205ca925eaf88f88725498799d74c3bf..a320291122b6f632b0bc36a8e96d15e42472a5f8 100644 (file)
@@ -15,33 +15,11 @@ class Authenticate
         if (!hasAppAccess()) {
             if ($request->ajax()) {
                 return response('Unauthorized.', 401);
-            } else {
-                return redirect()->guest(url('/login'));
             }
-        }
-
-        return $next($request);
-    }
-
-    /**
-     * Provide an error response for when the current user's email is not confirmed
-     * in a system which requires it.
-     */
-    protected function emailConfirmationErrorResponse(Request $request)
-    {
-        if ($request->wantsJson()) {
-            return response()->json([
-                'error' => [
-                    'code'    => 401,
-                    'message' => trans('errors.email_confirmation_awaiting'),
-                ],
-            ], 401);
-        }
 
-        if (session()->get('sent-email-confirmation') === true) {
-            return redirect('/register/confirm');
+            return redirect()->guest(url('/login'));
         }
 
-        return redirect('/register/confirm/awaiting');
+        return $next($request);
     }
 }