mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-12 22:17:22 +01:00
idk
This commit is contained in:
parent
fc9953bb8d
commit
9e6108a4d6
2 changed files with 4 additions and 4 deletions
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue