Skip to content

Commit b801d27

Browse files
committed
Properly check for empty basic auth when trying to log in a user on CORS annotated endpoints
Signed-off-by: Julius Härtl <jus@bitgrid.net>
1 parent cf5b33f commit b801d27

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/private/AppFramework/Middleware/Security/CORSMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function beforeController($controller, $methodName) {
9595
}
9696
$this->session->logout();
9797
try {
98-
if (!$this->session->logClientIn($user, $pass, $this->request, $this->throttler)) {
98+
if (!empty($user) && !empty($pass) && !$this->session->logClientIn($user, $pass, $this->request, $this->throttler)) {
9999
throw new SecurityException('CORS requires basic auth', Http::STATUS_UNAUTHORIZED);
100100
}
101101
} catch (PasswordLoginForbiddenException $ex) {

0 commit comments

Comments
 (0)