Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md for finalizeTwoFactor #480

Closed
wants to merge 1 commit into from

Conversation

matvejs16
Copy link

String type is correct instead of Buffer

Not working example:

// secret is string
client.finalizeTwoFactor(Buffer.from(secret), emailCode, (err) => {})

Correct example:

// secret is string
client.finalizeTwoFactor(secret, emailCode, (err) => {})

string type is correct instead of Buffer
@DoctorMcKay
Copy link
Owner

finalizeTwoFactor does in fact accept a Buffer in addition to a string. Buffer.from is failing because you didn't specify an encoding, which defaults to 'utf8'. You likely want to specify 'base64' as your encoding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants