feat(auth): add MizbanSMS OTP provider with per-flow messages and signup recovery

- Add MizbanSMS as selectable SMS provider (SMS_PROVIDER), keep Kavenegar
- Distinct OTP wording per flow via OtpMessageKind (register/login/change-phone)
- register() resumes an unverified account instead of blocking re-registration
- Hourly cleanup of abandoned unverified accounts (>24h) + expired OTP codes

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
keyhan
2026-06-17 17:44:58 +03:30
parent 7d7971744e
commit fc3d0a7e04
6 changed files with 265 additions and 33 deletions
+14
View File
@@ -15,6 +15,20 @@ export enum VerificationPurpose {
CHANGE_PHONE = 'change_phone',
}
/**
* Which OTP wording to send. Registration and passwordless login share the
* LOGIN verification purpose but want different message text, so the message
* kind is tracked separately from the purpose.
*/
export enum OtpMessageKind {
/** First-time signup / completing verification of an unverified account. */
REGISTER = 'register',
/** Passwordless one-time-password login for a verified account. */
LOGIN = 'login',
/** Confirming a new phone number from the account page. */
CHANGE_PHONE = 'change_phone',
}
export enum TicketDepartment {
TECHNICAL = 'technical',
SALES = 'sales',