fix(storage): parse enums properly#1451
fix(storage): parse enums properly#1451Caceresenzo wants to merge 3 commits intoAuthenticator-Extension:devfrom
Conversation
|
@mymindstorm would you have a chance to look at this PR |
|
Hey, really appreciate this. I want to let y'all know that I am aware of the fixes piling up. I will try to get to merging and deploying, but am currently not at a point where I can commit enough time to do so. |
|
@mymindstorm thank you! looking forward to it. If there is anything that I can help you let me know! |
|
@mymindstorm I get that you are extremely busy - many of us are. |
Fix incorrect parsing of the OTP algorithm introduced in version 8.0.0 to enable this feature.
The code before (in v7.0.0):
Authenticator/src/models/storage.ts
Lines 383 to 384 in bf630cc
The code after (in v8.0.0):
Authenticator/src/models/storage.ts
Lines 490 to 492 in 2cf9b0f
@mymindstorm parsed the algorithm-friendly name (
SHA***) as an integer instead of casting the enum directly. This resulted in aNaN, which would be stripped during serialization.Since
SHA1is now considered insecure, companies are likely usingSHA256, which cannot be parsed and defaults toSHA1.I wasn't sure if keeping
undefinedwas what you wanted. Revert 1fc616b if you think it's better to always useSHA1as the default.It's the same parsing mistake for the
type, but this one "worked" because the fallback wasOTPType.totp(the most commonly used).All of the following issues will likely be fixed by this pull request.
Fixes #1442
Fixes #1443
Fixes #1449
Fixes #1450