]> BookStack Code Mirror - bookstack/blobdiff - app/Http/Controllers/Auth/LoginController.php
Fixed tests from streaming changes
[bookstack] / app / Http / Controllers / Auth / LoginController.php
index 7c8eb2c864f2cdcb6a7030defaabec161540cd02..742e1047284403518e8b3ac73cb081c560be945b 100644 (file)
@@ -2,11 +2,11 @@
 
 namespace BookStack\Http\Controllers\Auth;
 
-use Activity;
 use BookStack\Auth\Access\LoginService;
 use BookStack\Auth\Access\SocialAuthService;
 use BookStack\Exceptions\LoginAttemptEmailNeededException;
 use BookStack\Exceptions\LoginAttemptException;
+use BookStack\Facades\Activity;
 use BookStack\Http\Controllers\Controller;
 use Illuminate\Foundation\Auth\AuthenticatesUsers;
 use Illuminate\Http\Request;
@@ -43,7 +43,8 @@ class LoginController extends Controller
     public function __construct(SocialAuthService $socialAuthService, LoginService $loginService)
     {
         $this->middleware('guest', ['only' => ['getLogin', 'login']]);
-        $this->middleware('guard:standard,ldap', ['only' => ['login', 'logout']]);
+        $this->middleware('guard:standard,ldap', ['only' => ['login']]);
+        $this->middleware('guard:standard,ldap,oidc', ['only' => ['logout']]);
 
         $this->socialAuthService = $socialAuthService;
         $this->loginService = $loginService;
@@ -175,16 +176,16 @@ class LoginController extends Controller
      */
     protected function validateLogin(Request $request)
     {
-        $rules = ['password' => 'required|string'];
+        $rules = ['password' => ['required', 'string']];
         $authMethod = config('auth.method');
 
         if ($authMethod === 'standard') {
-            $rules['email'] = 'required|email';
+            $rules['email'] = ['required', 'email'];
         }
 
         if ($authMethod === 'ldap') {
-            $rules['username'] = 'required|string';
-            $rules['email'] = 'email';
+            $rules['username'] = ['required', 'string'];
+            $rules['email'] = ['email'];
         }
 
         $request->validate($rules);