MCPcopy Create free account
hub / github.com/bewcloud/bewcloud / verifyCode

Method verifyCode

lib/models/multi-factor-auth/email.ts:37–49  ·  view source on GitHub ↗
(
    methodId: string,
    code: string,
    user: User,
  )

Source from the content-addressed store, hash-verified

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}

Callers 2

postFunction · 0.80
postFunction · 0.80

Calls 1

validateMethod · 0.80

Tested by

no test coverage detected