(
methodId: string,
code: string,
user: User,
)
| 35 | } |
| 36 | |
| 37 | static async verifyCode( |
| 38 | methodId: string, |
| 39 | code: string, |
| 40 | user: User, |
| 41 | ): Promise<boolean> { |
| 42 | try { |
| 43 | await VerificationCodeModel.validate(user, `${user.email}-${methodId}`, code, 'email'); |
| 44 | |
| 45 | return true; |
| 46 | } catch { |
| 47 | return false; |
| 48 | } |
| 49 | } |
| 50 | } |