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

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

Merged
merged 2 commits into from
Jul 9, 2024

Conversation

hicallmeal
Copy link
Contributor

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.

… tokens

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

This just parseInts the string so that it's correctly handled.
Copy link
Member

@mymindstorm mymindstorm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@mymindstorm
Copy link
Member

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

@mymindstorm mymindstorm self-requested a review July 2, 2024 00:27
Given the issue derives from the `option`s returning the value as a string by default, the 'number' modifier typecasts the value as a number. 

This then correctly flows on to the script execution
https://v2.vuejs.org/v2/guide/forms.html
@hicallmeal
Copy link
Contributor Author

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.

@mymindstorm mymindstorm merged commit 66197dc into Authenticator-Extension:dev Jul 9, 2024
6 checks passed
@hicallmeal hicallmeal deleted the patch-1 branch July 9, 2024 12:26
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