Authenticator-Extension / Authenticator

Authenticator generates 2-Step Verification codes in your browser.
https://authenticator.cc
MIT License
3.07k stars 727 forks source link

Implement work-around/fix for incorrect render of manually added HOTP tokens #1221

Open hicallmeal opened 4 days ago

hicallmeal commented 4 days ago

The parsed <option> returns the OTP.type as a string, instead of the required integer type. Later in execution, the code can't handle the string in comparisons, etc.

As a result, selecting a different type causes the resulting entry to be handled as a standard TOTP type. Giving it the appearance and behaviour as such - it also affects backups (..&counter=undefined) if done so in the same session. Any type of operation apart from the default type (as that's assigned an integer by default) with the option is affected. image

In saying that, once reloaded, some other part of the code corrects the entry and storage.

This just parseInts the string so that it's correctly handled. You might have some better way of doing this, perhaps earlier on, etc.

mymindstorm commented 4 days ago

Could you fix the CI issue and manually test the changes? npm run chrome -> chrome://extensions should allow you to do so.

hicallmeal commented 3 days ago

I've updated the patch according to commit notes; essentially in order to return an integer, a .number modifier is required. https://v2.vuejs.org/v2/guide/forms.html#number

Have tested and compiled successfully.