Restore 0098 SOAP SMS with link fallback and clearer errors

This commit is contained in:
2026-05-25 13:22:13 +03:30
parent 1da070969e
commit 27bd903e9d
4 changed files with 115 additions and 155 deletions
+6 -2
View File
@@ -98,13 +98,17 @@ export class AuthService {
'SMS is not configured. Set SMS_USERNAME, SMS_PASSWORD (or SMS_API_KEY), and SMS_SENDER.',
);
}
const result = await this.sms.sendOtpSmsDetailed(mobile, code);
const result = await this.sms.sendSmsDetailed(
mobile,
`کد ورود منتایم: ${code}`,
);
if (!result.ok) {
const detail = result.reason ? ` (${result.reason})` : '';
this.logger.warn(
`OTP SMS failed for ${this.maskMobile(mobile)} transport=${result.transport} reason=${result.reason}`,
);
throw new ServiceUnavailableException(
`Could not send SMS. Please try again later. (${result.reason})`,
`Could not send SMS. Please try again later.${detail}`,
);
}
}