Class VerificationService
Methods
Protected
genCode
- genCode(): string
-
Returns string
getMailClient
- getMailClient(): Transporter<SentMessageInfo>
-
Returns Transporter<SentMessageInfo>
Protected
getTarget
- getTarget(user: User, approach: string): undefined | string
-
Returns undefined | string
renderEmail
- renderEmail(tpl: EmailTemplate, vars: any): { content: string; subject: string }
-
Returns { content: string; subject: string }
-
content: string
-
subject: string
replacePlaceholder
- replacePlaceholder(str: string, vars: Record<string, string>): string
-
Parameters
-
str: string
-
vars: Record<string, string>
Returns string
send
- send(verification: Verification, user: User): undefined | Promise<void>
-
Returns undefined | Promise<void>
sendMail
- sendMail(to: string, intent: VerificationIntent, vars: any): Promise<void>
-
Returns Promise<void>
Protected
unreachable
- unreachable(message?: string): never
-
Returns never
verify
- verify(userId: bigint, intent: VerificationIntent, code: string, noExpire?: boolean): Promise<void>
-
Parameters
-
userId: bigint
-
-
code: string
-
noExpire: boolean = false
Returns Promise<void>