Skip to content

Commit

Permalink
phan fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
driusan committed Dec 19, 2022
1 parent e27fa14 commit 9390b6c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion modules/oidc/php/callback.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ class Callback extends \NDB_Page
",
['providerid' => $oidcstate['OpenIDProviderID']]
);
if (empty($clientsettings)) {
return new \LORIS\Http\Response\JSON\InternalServerError(
"Could not find provider settings"
);
}

$client = new \GuzzleHttp\Client(
[
Expand Down Expand Up @@ -130,7 +135,9 @@ class Callback extends \NDB_Page
} else {
// Not clear what the correct response here is. We can't trust the email,
// but everything is configured correctly and the workflow worked..
return new \LORIS\Http\Response\JSON\OK("Email not verified");
return new \LORIS\Http\Response\JSON\OK(
["error" => "Email not verified"],
);
}
}

Expand Down Expand Up @@ -209,6 +216,9 @@ class Callback extends \NDB_Page
}
$respjson = json_decode($response->getBody(), true);

if (!is_array($respjson)) {
return null;
}
// We don't actually care about this but it implies that something
// went wrong.
if ($respjson['token_type'] !== 'Bearer') {
Expand Down

0 comments on commit 9390b6c

Please sign in to comment.