mirror of
https://github.com/fosrl/pangolin.git
synced 2025-07-24 04:34:55 +02:00
server admin enforce 2fa per user
This commit is contained in:
parent
590296e64d
commit
915ccdc007
32 changed files with 1072 additions and 1123 deletions
10
server/lib/totp.ts
Normal file
10
server/lib/totp.ts
Normal file
|
@ -0,0 +1,10 @@
|
|||
import { alphabet, generateRandomString } from "oslo/crypto";
|
||||
|
||||
export async function generateBackupCodes(): Promise<string[]> {
|
||||
const codes = [];
|
||||
for (let i = 0; i < 10; i++) {
|
||||
const code = generateRandomString(6, alphabet("0-9", "A-Z", "a-z"));
|
||||
codes.push(code);
|
||||
}
|
||||
return codes;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue