Skip to content

Commit

Permalink
Log HTTP code, error code
Browse files Browse the repository at this point in the history
  • Loading branch information
gfrn committed Sep 27, 2023
1 parent 13fb53d commit cb616c4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions api/src/Authentication/Type/OIDC.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ function __construct() {
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$errno = curl_errno($ch);

if (curl_errno($ch) || curl_getinfo($ch, CURLINFO_HTTP_CODE != 200)) {
error_log("Failed to connect to OIDC discovery endpoint");
if ($errno || http_code != 200) {
error_log("Failed to connect to OIDC discovery endpoint. HTTP code: " . $http_code . ". CURL err. no.: " . $errno);
return;
}

Expand Down

0 comments on commit cb616c4

Please sign in to comment.