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

Fix broken URL path in generateUrl() #308

Merged
merged 1 commit into from
Oct 1, 2024

Conversation

austin-dudzik
Copy link

This pull request is to fix broken/missing issuer and user values that weren't getting added to the returned URL from the generateUrl() function.

After some digging, it appears that otpauth://totp is not read as a valid URL, as seen below. //totp is getting read as the pathname, instead of being included in the protocol, in which case seems to cause the URL() constructor to ignore attempts to set a new pathname on the URL.

image

To circumvent this, the pathname value, which includes the issuer and user values has been moved into the URL constructor, which now allows generateUrl() to return the proper, full otpauth:// URL value.

Before: otpauth://totp/?issuer=Issuer&period=30&secret=value

After: otpauth://totp/Issuer:fake@email.com?issuer=Issuer&period=30&secret=value

Fixed broken/missing issuer and user values that weren't getting added to the returned URL from the generateUrl() function, since "otpauth://totp" is not read as a valid URL.
@n0cloud n0cloud self-assigned this Oct 1, 2024
@n0cloud n0cloud closed this Oct 1, 2024
@n0cloud n0cloud reopened this Oct 1, 2024
@n0cloud n0cloud merged commit de212ae into PlanetHoster:main Oct 1, 2024
8 checks passed
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