-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from oslo-project/totp-grace-period
Add verifyTOTPWithGracePeriod()
- Loading branch information
Showing
4 changed files
with
52 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
title: "verifyTOTPWithGracePeriod()" | ||
--- | ||
|
||
Verifies a TOTP using [`verifyTOTP()`](/reference/main/verifyTOTP) with a grace period. If the grace period is 30 seconds for example, the OTP is valid if it was generated within the 30-second time span before or after the current machine time (60 seconds in total). | ||
|
||
```ts | ||
function verifyTOTPWithGracePeriod( | ||
key: Uint8Array, | ||
intervalInSeconds: number, | ||
digits: number, | ||
otp: string, | ||
gracePeriodInSeconds: number | ||
): boolean; | ||
``` | ||
|
||
### Parameters | ||
|
||
- `key`: HMAC key | ||
- `intervalInSeconds` | ||
- `digits` | ||
- `otp` | ||
- `gracePeriodInSeconds` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
export { generateHOTP, verifyHOTP, createHOTPKeyURI } from "./hotp.js"; | ||
export { generateTOTP, verifyTOTP, createTOTPKeyURI } from "./totp.js"; | ||
export { generateTOTP, verifyTOTP, verifyTOTPWithGracePeriod, createTOTPKeyURI } from "./totp.js"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters