public async Task <UserInfoDto> GetUserInfo() { UserInfoDto userInfo = await _authorizeApi.GetUser(); bool IsAuthenticated = userInfo.IsAuthenticated; if (IsAuthenticated) { userInfo = await _authorizeApi.GetUserInfo(); } else { userInfo = new UserInfoDto { IsAuthenticated = false, Roles = new List <string>() }; } return(userInfo); }
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); }