Skip to content

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 ​

ParameterType
userIdstring
codestring
callbacksOAuthTotpCallbacks
options{ window?: number; }
options.window?number

Returns ​

Promise<{ replay?: boolean; valid: boolean; }>

Released under the MIT License.