nodejs中google-authenticator使用

  |  

GA 6 为验证码

1
2
3
4
5
6
7
import { authenticator } from "otplib";

authenticator.options = {
epoch: Date.now() - 30 * 1000,
};
const secret_key = authenticator.generateSecret();
console.log(authenticator.generate(secret_key));

文档

google-authenticator
Otplib

文章目录
  1. 1. GA 6 为验证码
  2. 2. 文档