feature/refactor: smartfeeds to reduce the client complexity

This commit is contained in:
Andy Burke 2025-10-10 16:39:44 -07:00
parent 46090d944a
commit f6cd05beac
19 changed files with 782 additions and 800 deletions

View file

@ -110,5 +110,10 @@ export async function verifyTotp(
t0: number = 0,
t: number = Date.now()
): Promise<boolean> {
return otp === await generateTotp(key, t0, t);
const valid_otps = [
await generateTotp(key, t0, t - 30_000),
await generateTotp(key, t0, t),
await generateTotp(key, t0, t + 30_000)
];
return valid_otps.includes(otp);
}