(secretBase32: string, label: string)
| 26 | * literal so tests with no env still produce a readable label. |
| 27 | */ |
| 28 | export 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 |
no outgoing calls
no test coverage detected