This commit is contained in:
rootdarkarchon
2023-10-25 02:30:42 +02:00
parent fc9953bb8d
commit 9e6108a4d6
2 changed files with 4 additions and 4 deletions

View File

@@ -270,7 +270,7 @@ public sealed partial class ApiController : DisposableMediatorSubscriberBase, IM
bool requireReconnect = await RefreshToken(ct).ConfigureAwait(false); bool requireReconnect = await RefreshToken(ct).ConfigureAwait(false);
if (requireReconnect) continue; if (requireReconnect) break;
_ = await CheckClientHealth().ConfigureAwait(false); _ = await CheckClientHealth().ConfigureAwait(false);
} }

View File

@@ -116,10 +116,10 @@ public sealed class TokenProvider : IDisposable, IMediatorSubscriber
throw new InvalidOperationException("No token present"); throw new InvalidOperationException("No token present");
} }
public async Task<string?> GetOrUpdateToken(CancellationToken ct, bool forceRenew = false) public async Task<string?> GetOrUpdateToken(CancellationToken ct)
{ {
bool renewal = forceRenew; bool renewal = false;
if (!forceRenew && _tokenCache.TryGetValue(CurrentIdentifier, out var token)) if (_tokenCache.TryGetValue(CurrentIdentifier, out var token))
{ {
var handler = new JwtSecurityTokenHandler(); var handler = new JwtSecurityTokenHandler();
var jwtToken = handler.ReadJwtToken(token); var jwtToken = handler.ReadJwtToken(token);