Skip to content

2FA failed on live server #65

@phantomAA92

Description

@phantomAA92

on local, it works well but on live server, it always failed.

const randomBuffer = crypto.randomBytes(10); // 80 bits
const encoder = new base32.Encoder();
const secret = encoder.write(randomBuffer).finalize();

const { verificationCode, totpSecret } = req.body;
const decodedSecret = new base32.Decoder().write(totpSecret).finalize();
const verified = notp.totp.verify(verificationCode, decodedSecret, { window: 1 });

Can you help me???

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions