Пример #1
0
        public async Task <IActionResult> Details()
        {
            IdentityUser identity = await _userManager.GetUserAsync(User);

            ActionResult actionResult;

            if (identity == null)
            {
                Logger.LogInformation($"Can't get a logged user.");
                actionResult = Ok(LoggoutUser);
            }
            else
            {
                var userInfo = identity.ToDTO(User);
                Logger.LogInformation($"Get a logged user : {userInfo}");
                actionResult = Ok(userInfo);
            }

            return(actionResult);
        }