* The user's code for a phone tool (whatsapp when unspecified), generating one if needed. A call * reuses whichever code they already have, WhatsApp first, before minting a new WhatsApp one.
(channel?: WhitelistChannel)
| 309 | * reuses whichever code they already have, WhatsApp first, before minting a new WhatsApp one. |
| 310 | */ |
| 311 | public defaultPhoneCode(channel?: WhitelistChannel): string { |
| 312 | if (channel === 'sms') return this.ensurePhoneCode('sms'); |
| 313 | if (channel === 'voice') { |
| 314 | return this.getPhoneCode('whatsapp') ?? this.getPhoneCode('sms') ?? this.ensurePhoneCode('whatsapp'); |
| 315 | } |
| 316 | return this.ensurePhoneCode('whatsapp'); |
| 317 | } |
| 318 | |
| 319 | /** The persisted Telegram code, generating and storing one on first use. */ |
| 320 | public ensureTelegramCode(): string { return this.ensureCode(this.TELEGRAM_CODE_KEY); } |
no test coverage detected