Ejemplo n.º 1
0
        public async Task <IActionResult> PutNewPatient()
        {
            ClaimsPrincipal userClaims = HttpContext.User;

            string email = userClaims.FindFirstValue(EmailClaimType);

            if (!string.IsNullOrEmpty(email))
            {
                var newuser = await _repo.AddAuthorizedPatientAsync(email);

                return(CreatedAtAction(nameof(GetAuth), new { id = newuser.Id }, newuser));
            }
            else
            {
                _logger.LogError("Could not get user claims.");
                return(Ok());
            }
        }