diff --git a/backend/auth/otp/request.php b/backend/auth/otp/request.php index 58676f80..b508ca21 100644 --- a/backend/auth/otp/request.php +++ b/backend/auth/otp/request.php @@ -216,5 +216,6 @@ if ($sentSuccessfully) { jsonError("OTP sent but failed to save verification data"); } } else { - jsonError("Failed to send verification code. Please try again."); + $errDetail = !empty($GLOBALS['last_otp_error']) ? $GLOBALS['last_otp_error'] : "Failed to send verification code. Please try again."; + jsonError($errDetail); }