misc: added timer

This commit is contained in:
Sheen Capadngan
2024-11-21 04:09:19 +08:00
parent bce3f3d676
commit 00dcadbc08
2 changed files with 71 additions and 8 deletions
@@ -65,7 +65,10 @@ export const TotpProvider = (): TDynamicProviderFns => {
authenticatorInstance.options = { step: period };
}
return { entityId, data: { TOTP: authenticatorInstance.generate(secret) } };
return {
entityId,
data: { TOTP: authenticatorInstance.generate(secret), TIME_REMAINING: authenticatorInstance.timeRemaining() }
};
};
const revoke = async (_inputs: unknown, entityId: string) => {