Skip to content

Commit

Permalink
Merge pull request #12 from Worth-NL/fix/EnvironmentVariables_UserAnd…
Browse files Browse the repository at this point in the history
…NotifyAreSwapped

Fix/environment variables user and notify are swapped
  • Loading branch information
Thomas-M-Krystyan authored Mar 26, 2024
2 parents d6bd86f + 721fc6d commit f3a81e0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions EventsHandler/Api/EventsHandler/Constants/DefaultValues.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ internal static class Authorization
internal static class OpenApiSecurityScheme
{
internal static string BearerFormat => "JWT";

internal static string BearerSchema => "Bearer";
}
}
#endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ internal async Task<TModel> ProcessGetAsync<TModel>(HttpClientTypes httpsClientT
(bool isSuccess, string jsonResult) = await this._httpSupplier.GetAsync(httpsClientType, organizationId, uri);

return isSuccess ? this._serializer.Deserialize<TModel>(jsonResult)
: throw new HttpRequestException(fallbackErrorMessage);
: throw new HttpRequestException($"{fallbackErrorMessage} | URI: {uri} | JSON response: {jsonResult}");
}

/// <summary>
Expand All @@ -111,7 +111,7 @@ internal async Task<TModel> ProcessPostAsync<TModel>(HttpClientTypes httpsClient
(bool isSuccess, string jsonResult) = await this._httpSupplier.PostAsync(httpsClientType, organizationId, uri, body);

return isSuccess ? this._serializer.Deserialize<TModel>(jsonResult)
: throw new HttpRequestException(fallbackErrorMessage);
: throw new HttpRequestException($"{fallbackErrorMessage} | URI: {uri} | JSON response: {jsonResult}");
}

#region Internal query methods
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ private HttpClient AuthorizeWithJwt(HttpClient httpClient)
this._configuration.User.Authorization.JWT.UserName());

// Set Authorization header
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", jwtToken);
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(
DefaultValues.Authorization.OpenApiSecurityScheme.BearerSchema, jwtToken);

return httpClient;
}
Expand Down

0 comments on commit f3a81e0

Please sign in to comment.