GitHub user dosubot[bot] added a comment to the discussion: Login redirection does not use subpath prefix
<!-- Answer --> The SQL Lab and logout double-prefixing are caused by the same pattern — frontend code redundantly adding the app root prefix to URLs that are already prefixed (either by Flask on the backend, or by React Router's `basename`). The fixes from [PR #39503](https://github.com/apache/superset/pull/39503) and [PR #38033](https://github.com/apache/superset/pull/38033) haven't landed in your 6.1.0 branch yet. Here are the manual patches you need to apply: **1. Logout button — `superset-frontend/src/features/home/RightMenu.tsx`** Find the logout link and remove `ensureAppRoot()`: ```diff <Menu.Item key="logout" onClick={handleLogout}> - <Typography.Link href={ensureAppRoot(navbarRight.user_logout_url)}> + <Typography.Link href={navbarRight.user_logout_url}> {t('Logout')} </Typography.Link> </Menu.Item> ``` The backend-provided `user_logout_url` already includes `/analytics` via Flask's URL routing [[1]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/views/base.py#L288), so wrapping it with `ensureAppRoot()` causes the double prefix [[2]](https://github.com/apache/superset/pull/38033). **2. SQL Lab menu item — same file (`RightMenu.tsx`)** Find the SQL query menu item and remove `makeUrl()`: ```diff { label: t('SQL query'), - url: makeUrl('/sqllab?new=true'), + url: '/sqllab?new=true', icon: ..., perm: 'can_sqllab', view: 'Superset', } ``` This is navigated via React Router's `<Link>` component, which already prepends the app root through its configured `basename` — so `makeUrl()` causes double-prefixing [[3]](https://github.com/apache/superset/pull/39503). **3. Other files with the same SQL Lab issue** (from [PR #39503](https://github.com/apache/superset/pull/39503)): - `superset-frontend/src/features/home/EmptyState.tsx` — change `makeUrl('/sqllab?new=true')` → `'/sqllab?new=true'` - `superset-frontend/src/pages/SavedQueryList/index.tsx` — change `history.push(makeUrl('/sqllab?...'))` → `history.push('/sqllab?...')` - `superset-frontend/src/features/databases/DatabaseModal/index.tsx` — change `redirectURL(makeUrl('/sqllab?db=true'))` → `redirectURL('/sqllab?db=true')` **Important:** Keep `makeUrl()` for `window.open()` calls — those bypass React Router and need the explicit prefix [[4]](https://github.com/apache/superset/pull/39503). After making these changes, rebuild the frontend (`npm run build`) and restart Superset. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fsuperset).* --- Docs are dead. Just use [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-tagline&utm_term=apache%2Fsuperset). [](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-feedback&utm_term=apache%2Fsuperset&message_id=e6b82175-251f-42b8-9598-d9f541108b05) [](https://github.dosu.com/apache/superset?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-ask-repo&utm_term=apache%2Fsuperset) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-share-team&utm_term=apache%2Fsuperset) GitHub link: https://github.com/apache/superset/discussions/40082#discussioncomment-16977152 ---- This is an automatically sent email for [email protected]. To unsubscribe, please send an email to: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
