Fix first run either not displaying the authentication window, or displaying it twice
parent
f6dbd013be
commit
8fbc72e343
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue