public async Task <IHttpActionResult> PostReset([FromUri] string code, [FromUri] string time, [FromBody] JObject value) { //string code = IdentityHelper.GetCodeFromRequest(Request); int userId = AccountUtils.GetUserIdFromQueryStringValue(time); if (String.IsNullOrEmpty(code) || userId == 0) { return(BadRequest()); } var password = (string)value["password"]; var result = await OwinUserManager.ResetPasswordAsync(userId, code, password); return(result.Succeeded ? StatusCode(HttpStatusCode.NoContent) : (IHttpActionResult)BadRequest(result.PlainErrorMessage())); }