Skip to content

Commit

Permalink
Properly check for empty basic auth when trying to log in a user on C…
Browse files Browse the repository at this point in the history
…ORS annotated endpoints

Signed-off-by: Julius Härtl <jus@bitgrid.net>
  • Loading branch information
juliusknorr committed Feb 7, 2020
1 parent cf5b33f commit b801d27
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function beforeController($controller, $methodName) {
}
$this->session->logout();
try {
if (!$this->session->logClientIn($user, $pass, $this->request, $this->throttler)) {
if (!empty($user) && !empty($pass) && !$this->session->logClientIn($user, $pass, $this->request, $this->throttler)) {
throw new SecurityException('CORS requires basic auth', Http::STATUS_UNAUTHORIZED);
}
} catch (PasswordLoginForbiddenException $ex) {
Expand Down

0 comments on commit b801d27

Please sign in to comment.