mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
8 lines
306 B
TypeScript
8 lines
306 B
TypeScript
import * as otplib from "otplib";
|
|
|
|
const secretValue = otplib.authenticator.generateSecret();
|
|
const tokenValue = otplib.authenticator.generate(secretValue);
|
|
|
|
let isValid = otplib.authenticator.check(tokenValue, secretValue);
|
|
isValid = otplib.authenticator.verify({secret: secretValue, token: tokenValue});
|