Skip to content

fix: Include app_root in next param - #37942

Merged
Vitor-Avila merged 1 commit into
masterfrom
fix/consider-app_root-on-login-url
Feb 18, 2026
Merged

Vitor-Avila merged 1 commit into
masterfrom
fix/consider-app_root-on-login-url

Conversation

@Vitor-Avila

Copy link
Copy Markdown
Contributor

SUMMARY

When logging in, the URL includes a next= param that determines where users should be redirected to. This param was not including the app_root value, causing 404 errors.

I thought about fixing this in the backend (adding it if missing while doing the redirect) but I think it would require overriding a FAB method, so I think it's a good compromise. Happy to revisit if needed.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before
Users are redirected to a URL without the app_root value after logging in, causing a 404 error.

After
The next= param includes the app_root value so the redirect works properly.

TESTING INSTRUCTIONS

Added integration tests. For manual testing, set a value for SUPERSET_APP_ROOT and check that the next= param during login works properly.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • 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

@bito-code-review

bito-code-review Bot commented Feb 12, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #1dd6f7

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: 5959078..5959078
    • superset/views/utils.py
    • tests/integration_tests/test_subdirectory_deployments.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@dosubot dosubot Bot added the authentication:access-control Rlated to access control label Feb 12, 2026
@codeant-ai-for-open-source

Copy link
Copy Markdown
Contributor

Sequence Diagram

Shows the change where redirect_to_login prepends the application's SCRIPT_NAME (app_root) to the "next" query parameter so post-login redirects include the subdirectory prefix.

sequenceDiagram
    participant Browser
    participant Backend
    participant AuthLogin

    Browser->>Backend: Request protected page (PATH_INFO, SCRIPT_NAME present)
    Backend->>Backend: Build next target = request.script_root + request.path/full_path
    Backend->>AuthLogin: Redirect to login URL with ?next=/app_root/...
    AuthLogin-->>Browser: 302 Location: /login?next=/app_root/...
Loading

Generated by CodeAnt AI

@Vitor-Avila
Vitor-Avila force-pushed the fix/consider-app_root-on-login-url branch from 5959078 to 239b91f Compare February 13, 2026 04:07
@bito-code-review

bito-code-review Bot commented Feb 13, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #308305

Actionable Suggestions - 0
Additional Suggestions - 1
  • superset/views/utils.py - 1
    • Update docstring for subdirectory support · Line 81-81
      The code change adds `request.script_root` to the target URL construction, making the resulting URL include the app root for subdirectory deployments. However, the docstring still claims the URL 'always remains relative'. Please update the docstring to reflect this change.
      Code suggestion
       @@ -71,1 +71,1 @@
      -    always remains relative, mirroring Flask-AppBuilder expectations.
      +    includes the app root for subdirectory deployments, mirroring Flask-AppBuilder expectations.
Review Details
  • Files reviewed - 2 · Commit Range: 239b91f..239b91f
    • superset/views/utils.py
    • tests/integration_tests/test_subdirectory_deployments.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@Antonio-RiveroMartnez Antonio-RiveroMartnez left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, this would be addressing a gap when using SUPERSET_APP_ROOT

@Vitor-Avila
Vitor-Avila merged commit 9ec56f5 into master Feb 18, 2026
60 checks passed
@Vitor-Avila
Vitor-Avila deleted the fix/consider-app_root-on-login-url branch February 18, 2026 22:52
@dr29bart

Copy link
Copy Markdown

@dosubot dosubot Bot mentioned this pull request Apr 20, 2026
3 tasks done
@sfirke

sfirke commented May 4, 2026

Copy link
Copy Markdown
Member

@dr29bart did you file that as new bug? It seems significant and I'm not confident people will see it here as a comment on an already-merged PR.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants