You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "TamayiM-WHO (via GitHub)" <gi...@apache.org> on 2026/08/06 14:50:22 UTC
[PR] fix(app-root): prevent double-prefixed logout link under SUPERSET_APP_ROOT [superset]
TamayiM-WHO opened a new pull request, #42848:
URL: https://github.com/apache/superset/pull/42848
### SUMMARY
Backport of the `RightMenu.tsx` hunk of #38033 to the `6.2` release branch, plus the regression test added in #39925.
`navbarRight.user_logout_url` comes from Flask-AppBuilder's `get_url_for_logout`, which resolves through Flask's `url_for` and is therefore already `SCRIPT_NAME`-aware. On `6.2` it is still wrapped in `ensureAppRoot()`, which prefixes the application root a second time, so the Logout menu item points outside the mount point and 404s under a sub-path deployment.
This is the asymmetry that makes the bug easy to miss: `menu_data` emits `user_info_url` as the *relative* literal `/user_info/` (so it does need prefixing), while `user_logout_url` arrives already rooted. Both were being wrapped identically, so exactly one of them doubled.
```python
# superset/views/base.py
"user_info_url": (None if is_feature_enabled("MENU_HIDE_USER_INFO") else "/user_info/"),
"user_logout_url": appbuilder.get_url_for_logout, # already SCRIPT_NAME-prefixed
```
This was reported as #40576 and closed as fixed on `master`, but the fix never reached a release branch. Evaluating the shipped `ensureAppRoot` body on each ref against the value the backend actually emits (`APPLICATION_ROOT=/app-superset`):
```
origin/6.1 Logout href -> /app-superset/app-superset/logout/ (broken)
origin/6.2 Logout href -> /app-superset/app-superset/logout/ (broken)
origin/master Logout href -> /app-superset/logout/ (ok)
```
6.1.0 already shipped this, and `6.2` would ship it again without this backport.
`master` additionally carries an idempotence guard inside `ensureAppRoot()` itself. That is deliberately **not** backported here — the one-line `RightMenu.tsx` change is sufficient and is the smaller risk on a release branch.
Happy to open the equivalent PR against `6.1` if maintainers want it there too.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before (`APPLICATION_ROOT=/app-superset`), Settings → Logout:
```
href="/app-superset/app-superset/logout/" -> 404
```
After:
```
href="/app-superset/logout/" -> logs out
```
### TESTING INSTRUCTIONS
Automated — this PR ports the regression test #39925 added on `master`, where it passes. It asserts the Logout `href` stays single-prefixed when the backend supplies an already-rooted URL, so it fails against `6.2`'s current `ensureAppRoot()` wrapping:
```bash
cd superset-frontend
npm run test -- src/features/home/RightMenu.test.tsx -t "single-prefixed"
```
Manual:
1. Run Superset with `SUPERSET_APP_ROOT=/app-superset` (or `APPLICATION_ROOT`) behind a proxy that routes only `/app-superset/*`.
2. Log in, open the Settings menu, and inspect the Logout item's `href`.
3. It should be `/app-superset/logout/`, not `/app-superset/app-superset/logout/`, and clicking it should log you out rather than 404.
### ADDITIONAL INFORMATION
- [x] Has associated issue: #40576 (fixed on `master` by #38033; this backports it to `6.2`)
- [ ] Required feature flags:
- [x] Changes UI
- [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(app-root): prevent double-prefixed logout link under SUPERSET_APP_ROOT [superset]
Posted by "sadpandajoe (via GitHub)" <gi...@apache.org>.
sadpandajoe closed pull request #42848: fix(app-root): prevent double-prefixed logout link under SUPERSET_APP_ROOT
URL: https://github.com/apache/superset/pull/42848
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(app-root): prevent double-prefixed logout link under SUPERSET_APP_ROOT [superset]
Posted by "netlify[bot] (via GitHub)" <gi...@apache.org>.
netlify[bot] commented on PR #42848:
URL: https://github.com/apache/superset/pull/42848#issuecomment-5206440323
### <span aria-hidden="true">✅</span> Deploy Preview for *superset-docs-preview* ready!
| Name | Link |
|:-:|------------------------|
|<span aria-hidden="true">🔨</span> Latest commit | 4fcb3c0f1f14c16f2b628420fc217d2b879ebb63 |
|<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/6a749f2e5ebb1100087bb39f |
|<span aria-hidden="true">😎</span> Deploy Preview | [https://deploy-preview-42848--superset-docs-preview.netlify.app](https://deploy-preview-42848--superset-docs-preview.netlify.app) |
|<span aria-hidden="true">📱</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br /><br /><br />_Use your smartphone camera to open QR code link._</details> |
|<span aria-hidden="true">🤖</span> Make changes | [Run an agent on this branch](https://app.netlify.com/projects/superset-docs-preview/agent-runs#q1YqKMrPLShRslJS0lFKKkrMS84AstMyK_Rz8tPzS0t0izPz0nNSdQuKUoGCumZ6RkB1KakFOfmVnilAlWaJ5iaWaUappqlJSYaGBgYGFuZJScaWaUq1AA) |
---
<!-- [superset-docs-preview Preview](https://deploy-preview-42848--superset-docs-preview.netlify.app) -->
_To edit notification comments on pull requests, go to your [Netlify project configuration](https://app.netlify.com/projects/superset-docs-preview/configuration/notifications#deploy-notifications)._
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(app-root): prevent double-prefixed logout link under SUPERSET_APP_ROOT [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #42848:
URL: https://github.com/apache/superset/pull/42848#issuecomment-5206388485
**Bito Automatic Review Skipped - Branch Excluded**<br/><br/>Bito didn't auto-review because the source or target branch is excluded from automatic reviews.<br/>No action is needed if you didn't intend for the agent to review it. Otherwise, to manually trigger a review, type `/review` in a comment and save.<br/>You can change the branch exclusion settings [here](https://alpha.bito.ai/home/ai-agents/code-review-agent), or contact your Bito workspace admin at [evan@preset.io](mailto:evan@preset.io).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(app-root): prevent double-prefixed logout link under SUPERSET_APP_ROOT [superset]
Posted by "sadpandajoe (via GitHub)" <gi...@apache.org>.
sadpandajoe commented on PR #42848:
URL: https://github.com/apache/superset/pull/42848#issuecomment-5207820675
Closing this as this isn't how we would introduce changes into official release branches.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org