コード例 #1
0
 public IActionResult ResetPassword(ResetPasswordModel resetPasswordModel)
 {
     try
     {
         var identity = User.Identity as ClaimsIdentity;
         if (identity != null)
         {
             IEnumerable <Claim> claims = identity.Claims;
             var Email = claims.Where(p => p.Type == "Email").FirstOrDefault()?.Value;
             resetPasswordModel.Email = Email;
             bool result = bookBL.ResetCustomerAccountPassword(resetPasswordModel);
             if (result)
             {
                 return(Ok(new { success = true, Message = "password changed successfully" }));
             }
         }
         return(BadRequest(new { success = false, Message = "password change unsuccessfull" }));
     }
     catch (Exception exception)
     {
         return(BadRequest(new { success = false, exception.Message }));
     }
 }