Invalidate profile cache when logging out

Fixes #422
This commit is contained in:
Pat Hartl 2026-06-27 18:44:24 -05:00
parent e485ad1865
commit 171e7dcaf0
2 changed files with 10 additions and 2 deletions

View file

@ -21,7 +21,8 @@ public class AuthenticationClient(
IServerConfigurationRefresher configRefresher,
ISettingsProvider settingsProvider,
ApiRequestFactory apiRequestFactory,
IConnectionClient connectionClient)
IConnectionClient connectionClient,
ProfileClient profileClient)
{
public async Task<AuthToken> 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)

View file

@ -32,6 +32,11 @@ namespace LANCommander.SDK.Services
return _user;
}
public void ClearCache()
{
_user = null;
}
public async Task<string> GetAliasAsync()
{
try