fix: resolve header auth links from route roles - #306
Merged
arbrandes merged 1 commit intoAug 29, 2026
Conversation
The header's Login and Register buttons linked straight to the LMS using loginUrl and lmsBaseUrl, so an installed authentication app was bypassed even though it registers the login and register route roles. They now resolve those roles first, keeping the previous site config values as fallbacks, and navigate in the client when the resolved URL is a route in this site. Fixes openedx#305 Co-Authored-By: Claude <noreply@anthropic.com>
|
🎉 This PR is included in version 2.0.0-alpha.9 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The header's Login and Register buttons linked straight to the LMS, using
loginUrlandlmsBaseUrlfrom the site config. That bypassed an installed authentication app entirely, so on a site running@openedx/frontend-app-authnclicking Login in the header still landed the user on the legacy LMS login page instead of the app's own login route.Both buttons now resolve
org.openedx.frontend.role.loginandorg.openedx.frontend.role.registerthroughgetUrlByRouteRole()first, which is what the rest of the runtime already does when it needs a login destination. The previous site config values remain as fallbacks, so nothing changes for sites that do not install an authentication app.When the resolved URL turns out to be a route in this site rather than an external one, the buttons navigate in the client instead of triggering a full page load. A small helper handles that choice, since Paragon's
Buttontypes reject spreading a union of link props inline.Fixes #305
LLM usage notice
Built with assistance from Claude.