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)
|
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();
|
ShowAuthenticationWindow();
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,6 +82,12 @@ namespace LANCommander.PlaynitePlugin.Views
|
||||||
Plugin.Settings.AccessToken = response.AccessToken;
|
Plugin.Settings.AccessToken = response.AccessToken;
|
||||||
Plugin.Settings.RefreshToken = response.RefreshToken;
|
Plugin.Settings.RefreshToken = response.RefreshToken;
|
||||||
|
|
||||||
|
Plugin.LANCommander.Token = new AuthToken()
|
||||||
|
{
|
||||||
|
AccessToken = response.AccessToken,
|
||||||
|
RefreshToken = response.RefreshToken,
|
||||||
|
};
|
||||||
|
|
||||||
// Probably unneeded, but why not be more secure?
|
// Probably unneeded, but why not be more secure?
|
||||||
Context.Password = String.Empty;
|
Context.Password = String.Empty;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue