public async Task <UserViewModel> GetUserViewModel() { UserViewModel userViewModel = await _accountApiClient.GetUser(); bool IsAuthenticated = userViewModel.IsAuthenticated; if (IsAuthenticated) { userViewModel = await _accountApiClient.GetUserViewModel(); } else { userViewModel = new UserViewModel { IsAuthenticated = false, Roles = new List <string>() } }; return(userViewModel); }