Added logout functionality. IO-403

This commit is contained in:
Patrick Fic
2021-01-18 11:36:07 -08:00
parent 8b63557912
commit 34a5ae2292
5 changed files with 46 additions and 2 deletions

View File

@@ -174,5 +174,25 @@ namespace BodyshopPartner.ViewModels
}
}
private ICommand _logoutCommand;
public ICommand LogoutCommand
{
get
{
if (_logoutCommand == null)
{
_logoutCommand = new RelayCommand(
p => true,
p =>
{
Logout();
});
}
return _logoutCommand;
}
}
}
}

View File

@@ -189,7 +189,16 @@ namespace BodyshopPartner.ViewModels
IndeterminateLoading = false;
}
public async Task LoadBodyshopData()
public void Logout()
{
Properties.Settings.Default.AuthToken = "";
Properties.Settings.Default.RefreshToken = "";
Properties.Settings.Default.Save();
App.Current.Shutdown();
}
public async Task LoadBodyshopData()
{
var r = new GraphQLRequest
{