Ejemplo n.º 1
0
        public ActionResult UpdateContactDetails(ContactDetails contactDetails)
        {
            //call api to reset the password
            //get the current user
            var user = _authenticationManager.User;

            if (user == null)
            {
                return(UnauthorisedJson());
            }

            var subClaim = user.Claims.FirstOrDefault(c => c.Type == "sub");

            if (subClaim == null)
            {
                return(UnauthorisedJson());
            }

            var response = _coreClient.UpdateContactDetails(subClaim.Value, contactDetails);

            if (!response.Errored)
            {
                return(Json(new { success = true }));
            }
            Response.StatusCode = (int)HttpStatusCode.BadRequest;
            return(Json(new { success = false }));
        }