-
Notifications
You must be signed in to change notification settings - Fork 137
Open
Description
Describe the bug
I've implemented optlib in node js and it's working fine on the localhost but not on the live server.
Following is the backed code where I am checking it.
const { totp, authenticator } = require('otplib');
const appName = process.env.TOTP_APP_NAME;
const label = req.user ? req.user.email : 'user';
totp.options = { window: 1 };
const secret = authenticator.generateSecret();
const qrcode = require('qrcode');
const otpauthUrl = authenticator.keyuri(label, appName, secret);
const { verificationCode, totpSecret } = req.body;
const verified = authenticator.verify(verificationCode, totpSecret);
verified is always false on live server.
can you help me this bug???
Metadata
Metadata
Assignees
Labels
No labels