Restore 0098 SOAP SMS with link fallback and clearer errors
This commit is contained in:
@@ -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}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user