Browse Source

Fix token refresh when access token is empty

pull/629/head
Ionite 7 months ago
parent
commit
d3b37229da
No known key found for this signature in database
  1. 3
      StabilityMatrix.Core/Api/TokenAuthHeaderHandler.cs

3
StabilityMatrix.Core/Api/TokenAuthHeaderHandler.cs

@ -22,7 +22,8 @@ public class TokenAuthHeaderHandler : DelegatingHandler
.HandleResult<HttpResponseMessage>( .HandleResult<HttpResponseMessage>(
r => r =>
r.StatusCode is HttpStatusCode.Unauthorized or HttpStatusCode.Forbidden r.StatusCode is HttpStatusCode.Unauthorized or HttpStatusCode.Forbidden
&& r.RequestMessage?.Headers.Authorization is { Scheme: "Bearer", Parameter: not null } && r.RequestMessage?.Headers.Authorization is { Scheme: "Bearer", Parameter: { } param }
&& !string.IsNullOrWhiteSpace(param)
) )
.RetryAsync( .RetryAsync(
async (result, _) => async (result, _) =>

Loading…
Cancel
Save