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