Пример #1
0
        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);
        }