From d3b37229dae439f36288ff790f56f7ce780f4f08 Mon Sep 17 00:00:00 2001 From: Ionite Date: Fri, 12 Apr 2024 22:38:32 -0400 Subject: [PATCH] Fix token refresh when access token is empty --- StabilityMatrix.Core/Api/TokenAuthHeaderHandler.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/StabilityMatrix.Core/Api/TokenAuthHeaderHandler.cs b/StabilityMatrix.Core/Api/TokenAuthHeaderHandler.cs index 3efe6847..b042d6b7 100644 --- a/StabilityMatrix.Core/Api/TokenAuthHeaderHandler.cs +++ b/StabilityMatrix.Core/Api/TokenAuthHeaderHandler.cs @@ -22,7 +22,8 @@ public class TokenAuthHeaderHandler : DelegatingHandler .HandleResult( r => 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( async (result, _) =>