Skip to content

fix: resolve header auth links from route roles - #306

Merged
arbrandes merged 1 commit into
openedx:mainfrom
arbrandes:arbrandes/header-auth-route-roles
Aug 29, 2026
Merged

fix: resolve header auth links from route roles#306
arbrandes merged 1 commit into
openedx:mainfrom
arbrandes:arbrandes/header-auth-route-roles

Conversation

@arbrandes

Copy link
Copy Markdown
Contributor

Description

The header's Login and Register buttons linked straight to the LMS, using loginUrl and lmsBaseUrl from the site config. That bypassed an installed authentication app entirely, so on a site running @openedx/frontend-app-authn clicking 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.login and org.openedx.frontend.role.register through getUrlByRouteRole() 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 Button types reject spreading a union of link props inline.

Fixes #305

LLM usage notice

Built with assistance from Claude.

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>
@arbrandes
arbrandes enabled auto-merge (rebase) August 29, 2026 15:40
@arbrandes
arbrandes merged commit ea6b81c into openedx:main Aug 29, 2026
5 checks passed
@arbrandes
arbrandes deleted the arbrandes/header-auth-route-roles branch August 29, 2026 15:43
@openedx-semantic-release-bot

Copy link
Copy Markdown

🎉 This PR is included in version 2.0.0-alpha.9 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Header Login and Register buttons ignore the login and register route roles

2 participants