TypeScript API / @laikacms/server/oauth2 / verifyOAuthTOTPWithReplayProtection
Function: verifyOAuthTOTPWithReplayProtection()
ts
function verifyOAuthTOTPWithReplayProtection(
userId,
code,
callbacks,
options?
): Promise<{
replay?: boolean;
valid: boolean;
}>;Verify a TOTP code against the OAuth callbacks with RFC 6238 §5.2 replay protection: codes whose time step is less than or equal to the previously consumed step are rejected.
Parameters
| Parameter | Type |
|---|---|
userId | string |
code | string |
callbacks | OAuthTotpCallbacks |
options | { window?: number; } |
options.window? | number |
Returns
Promise<{ replay?: boolean; valid: boolean; }>