egg-otp
One time password plugin for eggjs.
Install
$ npm i egg-otp --save
Usage
// {app_root}/config/plugin.jsexportsotp = enable: true package: 'egg-otp';// {app_root}/controller/home.jsconst key = ctxotp;const token = ctxotphotp;ctxotphotp;
you can see lib/hotp.js AND lib/totp.js for more option.
Configuration
see config/config.default.js for more detail.