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

Make HTTP Basic Auth aware of path-prefix #8789

Merged
merged 1 commit into from
Dec 5, 2024

Conversation

jrbntt
Copy link
Contributor

@jrbntt jrbntt commented Nov 30, 2024

As documented in #8788, if a user combines a path-prefix and readers=(anon) for the Node.js server, manual HTTP Basic Authentication via "/login-basic" will redirect the authenticated user to the server root "/" instead of the correct URI including the path prefix.

This PR makes a small change to prefix the default redirection URL with the value of the path prefix.

It appears that the server boot process will set state.pathPrefix to "" if it is not configured, so it should be safe to simply reference the value in a string template without an additional conditional check at the moment of use. I have tested this change both with and without the path-prefix server parameter and was correctly redirected after authentication in both configurations.

Closes #8788

Copy link

Confirmed: jrbntt has already signed the Contributor License Agreement (see contributing.md)

Copy link

netlify bot commented Nov 30, 2024

Deploy Preview for tiddlywiki-previews ready!

Name Link
🔨 Latest commit 61c9404
🔍 Latest deploy log https://app.netlify.com/sites/tiddlywiki-previews/deploys/674a8200d233b700086f91fa
😎 Deploy Preview https://deploy-preview-8789--tiddlywiki-previews.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@Jermolene
Copy link
Member

Thanks @jrbntt

@Jermolene Jermolene merged commit c7f741d into TiddlyWiki:master Dec 5, 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.

[BUG] Node.js Server: Incorrect redirect after HTTP Basic Auth when using path-prefix
2 participants