Fix first run either not displaying the authentication window, or displaying it twice

pull/19/head
Pat Hartl 2023-03-08 20:07:27 -06:00
parent f6dbd013be
commit 8fbc72e343
2 changed files with 7 additions and 1 deletions

View File

@ -55,7 +55,7 @@ namespace LANCommander.PlaynitePlugin
public override void OnApplicationStarted(OnApplicationStartedEventArgs args)
{
if (LANCommander.Token == null || !LANCommander.ValidateToken(LANCommander.Token))
if (LANCommander.Token == null || LANCommander.Client == null || !LANCommander.ValidateToken(LANCommander.Token))
{
ShowAuthenticationWindow();
}

View File

@ -82,6 +82,12 @@ namespace LANCommander.PlaynitePlugin.Views
Plugin.Settings.AccessToken = response.AccessToken;
Plugin.Settings.RefreshToken = response.RefreshToken;
Plugin.LANCommander.Token = new AuthToken()
{
AccessToken = response.AccessToken,
RefreshToken = response.RefreshToken,
};
// Probably unneeded, but why not be more secure?
Context.Password = String.Empty;