MCPcopy Create free account
hub / github.com/boringstack-xyz/boringstack / buildTotp

Function buildTotp

apps/api/src/api/auth/services/mfa.utils.ts:28–36  ·  view source on GitHub ↗
(secretBase32: string, label: string)

Source from the content-addressed store, hash-verified

26 * literal so tests with no env still produce a readable label.
27 */
28export const buildTotp = (secretBase32: string, label: string): TOTP =>
29 new TOTP({
30 issuer: env.APP_NAME === "" ? MFA_DEFAULT_ISSUER : env.APP_NAME,
31 label,
32 algorithm: "SHA1",
33 digits: MFA_TOTP_DIGITS,
34 period: MFA_TOTP_STEP_SECONDS,
35 secret: Secret.fromBase32(secretBase32),
36 });
37
38/**
39 * Generate a fresh batch of plaintext recovery codes. The caller is

Callers 4

setupMethod · 0.90
verifySetupMethod · 0.90
verifyTotpLoginMethod · 0.90
mfa.utils.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected