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

Function totpFor

apps/api/tests/api/auth/mfa.routes.test.ts:59–69  ·  view source on GitHub ↗
(secretBase32: string, offsetSteps = 0)

Source from the content-addressed store, hash-verified

57 "user" in value.data;
58
59const totpFor = (secretBase32: string, offsetSteps = 0): string =>
60 new TOTP({
61 issuer: "test",
62 label: "test",
63 algorithm: "SHA1",
64 digits: MFA_TOTP_DIGITS,
65 period: MFA_TOTP_STEP_SECONDS,
66 secret: Secret.fromBase32(secretBase32),
67 }).generate({
68 timestamp: Date.now() + offsetSteps * MFA_TOTP_STEP_SECONDS * 1000,
69 });
70
71const enrollViaService = async (
72 userId: string

Callers 2

enrollViaServiceFunction · 0.85
mfa.routes.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected