Browse Source

LoginViewModel now stores the correct access token as an application setting.

pull/223/head
David Britch 7 years ago
parent
commit
99bb40261d
1 changed files with 3 additions and 4 deletions
  1. +3
    -4
      src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/LoginViewModel.cs

+ 3
- 4
src/Mobile/eShopOnContainers/eShopOnContainers.Core/ViewModels/LoginViewModel.cs View File

@ -207,16 +207,15 @@ namespace eShopOnContainers.Core.ViewModels
private void Logout()
{
var authIdToken = Settings.AuthIdToken;
var logoutRequest = _identityService.CreateLogoutRequest(authIdToken);
if(!string.IsNullOrEmpty(logoutRequest))
if (!string.IsNullOrEmpty(logoutRequest))
{
// Logout
LoginUrl = logoutRequest;
}
if(Settings.UseMocks)
if (Settings.UseMocks)
{
Settings.AuthAccessToken = string.Empty;
Settings.AuthIdToken = string.Empty;
@ -244,7 +243,7 @@ namespace eShopOnContainers.Core.ViewModels
if (!string.IsNullOrWhiteSpace(accessToken))
{
Settings.AuthAccessToken = authResponse.AccessToken;
Settings.AuthAccessToken = accessToken;
Settings.AuthIdToken = authResponse.IdentityToken;
await NavigationService.NavigateToAsync<MainViewModel>();


Loading…
Cancel
Save