Skip to content

Commit

Permalink
fix: oauth redirection with root path = '/' (#1987)
Browse files Browse the repository at this point in the history
  • Loading branch information
willydouhard authored Mar 11, 2025
1 parent 428114f commit b84adea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Fixed

- Pasting text/images into Chainlit Copilot should now work
- OAuth redirection should work when submounting Chainlit with root path `/`

### Removed

Expand Down
1 change: 1 addition & 0 deletions backend/chainlit/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ def _get_auth_response(access_token: str, redirect_to_callback: bool) -> Respons

if redirect_to_callback:
root_path = os.environ.get("CHAINLIT_ROOT_PATH", "")
root_path = "" if root_path == "/" else root_path
redirect_url = (
f"{root_path}/login/callback?{urllib.parse.urlencode(response_dict)}"
)
Expand Down

0 comments on commit b84adea

Please sign in to comment.