diff --git a/LANCommander.SDK/Clients/AuthenticationClient.cs b/LANCommander.SDK/Clients/AuthenticationClient.cs index 20a0115c..26b99e03 100644 --- a/LANCommander.SDK/Clients/AuthenticationClient.cs +++ b/LANCommander.SDK/Clients/AuthenticationClient.cs @@ -21,7 +21,8 @@ public class AuthenticationClient( IServerConfigurationRefresher configRefresher, ISettingsProvider settingsProvider, ApiRequestFactory apiRequestFactory, - IConnectionClient connectionClient) + IConnectionClient connectionClient, + ProfileClient profileClient) { public async Task AuthenticateAsync(string username, string password, Uri serverAddress) { @@ -101,8 +102,10 @@ public class AuthenticationClient( { logger.LogWarning("Could not logout, server inaccessible"); } - + tokenProvider.SetToken(null); + + profileClient.ClearCache(); } public async Task RegisterAsync(string username, string password, string passwordConfirmation) diff --git a/LANCommander.SDK/Clients/ProfileClient.cs b/LANCommander.SDK/Clients/ProfileClient.cs index f0960fde..777f2a5d 100644 --- a/LANCommander.SDK/Clients/ProfileClient.cs +++ b/LANCommander.SDK/Clients/ProfileClient.cs @@ -32,6 +32,11 @@ namespace LANCommander.SDK.Services return _user; } + public void ClearCache() + { + _user = null; + } + public async Task GetAliasAsync() { try