Skip to content

2FA don't work on VPS. #154

@phantomAA92

Description

@phantomAA92

const appName = process.env.TOTP_APP_NAME;
const label = req.user ? req.user.email : 'user';
const { base32 }= speakeasy.generateSecret({
length: 20,
name: ${appName}:${label},
issuer: appName
});
.....
const { verificationCode, totpSecret } = req.body;
const verified = speakeasy.totp.verify({
secret: totpSecret,
encoding: 'base32',
token: verificationCode,
window: 1
});

it works well on local but when deploy to vps(ubuntu) don't works, it returns always false.
so i checked time of vps. but it is correct.
and secret same verificationCode.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions