some minor fixes

This commit is contained in:
rootdarkarchon
2023-10-25 12:31:16 +02:00
parent 24960fd1ba
commit 3383de7294
3 changed files with 8 additions and 6 deletions

View File

@@ -215,7 +215,7 @@ public sealed partial class ApiController : DisposableMediatorSubscriberBase, IM
catch (InvalidOperationException ex)
{
Logger.LogWarning(ex, "InvalidOperationException on connection");
ServerState = ServerState.Disconnected;
await StopConnection(ServerState.Disconnected).ConfigureAwait(false);
return;
}
catch (Exception ex)

View File

@@ -106,11 +106,10 @@ public sealed class TokenProvider : IDisposable, IMediatorSubscriber
if (jwtToken.ValidTo.Subtract(TimeSpan.FromHours(6).Add(TimeSpan.FromMinutes(1))) > DateTime.UtcNow)
{
_tokenCache.TryRemove(CurrentIdentifier, out _);
Mediator.Publish(new NotificationMessage("Invalid timezone", "The time zone of your computer is invalid. " +
Mediator.Publish(new NotificationMessage("Invalid system clock", "The clock of your computer is invalid. " +
"Mare will not function properly if the time zone is not set correctly. " +
"Please set your computers time zone correctly and keep it synchronized with the internet.",
"Please set your computers time zone correctly and keep your clock synchronized with the internet.",
Dalamud.Interface.Internal.Notifications.NotificationType.Error));
Mediator.Publish(new DisconnectedMessage());
throw new InvalidOperationException($"JwtToken is behind DateTime.UtcNow, DateTime.UtcNow is possibly wrong. DateTime.UtcNow is {DateTime.UtcNow}, JwtToken.ValidTo is {jwtToken.ValidTo}");
}
return response;