Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Commit

Permalink
Fix false positive in sso 2fa block
Browse files Browse the repository at this point in the history
  • Loading branch information
rijkvanzanten committed Nov 12, 2019
1 parent 0989b31 commit 557a83b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/endpoints/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ public function ssoService(Request $request, Response $response)
$origin = array_shift($origin);
}
$session->set('sso_origin_url', $origin);

$response = $response->withRedirect(array_get($responseData, 'data.authorization_url'));
}

Expand Down Expand Up @@ -388,7 +388,7 @@ public function ssoServiceCallback(Request $request, Response $response)
if(isset($responseData['data']) && isset($responseData['data']['user'])){
$usersService = new UsersService($this->container);
$tfa_enforced = $usersService->has2FAEnforced($responseData['data']['user']['id']);
if($tfa_enforced || !is_null($responseData['data']['user']['2fa_secret'])){
if($tfa_enforced || !empty($responseData['data']['user']['2fa_secret'])){
throw new SsoNotAllowedException();
}

Expand Down Expand Up @@ -424,7 +424,7 @@ public function ssoServiceCallback(Request $request, Response $response)
$urlParams = array_merge($redirectQueryParams, $urlParams);
}

$urlToRedirect = !empty($urlParams) ? $redirectUrl . '?' . http_build_query($urlParams) : $redirectUrl;
$urlToRedirect = !empty($urlParams) ? $redirectUrl . '?' . http_build_query($urlParams) : $redirectUrl;
$response = $response->withRedirect($urlToRedirect);

}else{
Expand Down

0 comments on commit 557a83b

Please sign in to comment.