TypeScript API / @laikacms/server/oauth2 / verifyTOTPWithStep
Function: verifyTOTPWithStep()
ts
function verifyTOTPWithStep(
secret,
code,
window?
): Promise<{
step?: number;
valid: boolean;
}>;Verify a TOTP code and return the matched time step. Callers that wish to implement RFC 6238 §5.2 replay protection use the returned step to ensure a code is only accepted once per user.
Parameters
| Parameter | Type | Default value |
|---|---|---|
secret | string | undefined |
code | string | undefined |
window | number | 1 |
Returns
Promise<{ step?: number; valid: boolean; }>