Add hotfix for empty access token with EResult.OK

This commit is contained in:
Archi
2023-10-20 16:08:33 +02:00
parent aa1c344b03
commit 02312dbee5

View File

@@ -1555,10 +1555,12 @@ public sealed class Bot : IAsyncDisposable, IDisposable {
CAuthentication_AccessToken_GenerateForApp_Response? response = await ArchiHandler.GenerateAccessTokens(RefreshToken!).ConfigureAwait(false);
if (response == null) {
if (string.IsNullOrEmpty(response?.access_token)) {
// The request has failed, in almost all cases this means our refresh token is no longer valid, relog needed
BotDatabase.RefreshToken = RefreshToken = null;
ArchiLogger.LogGenericWarning(string.Format(CultureInfo.CurrentCulture, Strings.WarningFailedWithError, nameof(ArchiHandler.GenerateAccessTokens)));
await Connect(true).ConfigureAwait(false);
return false;