public async Task <IActionResult> GetInfo() { var userId = HttpContext.User.Claims.FirstOrDefault(r => r.Type == ClaimTypes.NameIdentifier)?.Value; var user = await _userManager.GetById(userId); return(Ok(UserProfileRequest.Create(user))); }
public async Task <IActionResult> UpdateUserInfo(UpdateUserProfileRequest profileRequest) { var userId = HttpContext.User.Claims.FirstOrDefault(r => r.Type == ClaimTypes.NameIdentifier)?.Value; var user = await _userManager.GetById(userId); var toInsert = profileRequest.MergeToModel(user); await _userManager.UpdateProfileAsync(toInsert); return(Ok(UserProfileRequest.Create(toInsert))); }