fhqvst / avanza

A JavaScript client for the unofficial Avanza API
MIT License
229 stars 59 forks source link

2FA #47

Closed pontussalenbo closed 3 years ago

pontussalenbo commented 4 years ago

I recently started to use this project and I stumbled across errors when using TOTP. I followed the step by step in readme but when I submit the generated 6 digit code to Avanza it says that it is invalid while trying to activate 2FA, do you have an clue what I might be doing wrong?

3DJakob commented 3 years ago

One possible problem could be that it expired. Make sure you submit it just after generating it. That worked for me.

fhqvst commented 3 years ago

Make sure you paste the secret correctly. Here's an example:

node -e "console.log(require('avanza/dist/totp')('K01BADBT3218UD'))"