DoctorMcKay / node-steam-user

Allows interaction with the Steam network via the Steam client protocol
https://dev.doctormckay.com/forum/7-node-steam-user/
MIT License
888 stars 157 forks source link

Update README.md for finalizeTwoFactor #480

Closed matvejs16 closed 6 months ago

matvejs16 commented 6 months ago

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) => {})
DoctorMcKay commented 6 months ago

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.