Skip to content

Commit

Permalink
fix(enterprise): respect root for login url when not mounted under /
Browse files Browse the repository at this point in the history
  • Loading branch information
maartenbreddels committed Jun 24, 2023
1 parent 9cac720 commit d4fb2a1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/solara-enterprise/solara_enterprise/auth/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ def get_login_url(return_to_path: Optional[str] = None):
return_to_path = return_to_path[1:]
assert settings.main.base_url is not None
redirect_uri = urllib.parse.quote(settings.main.base_url + return_to_path)
return f"/_solara/auth/login?redirect_uri={redirect_uri}"
root = settings.main.root_path or ""
return f"{root}/_solara/auth/login?redirect_uri={redirect_uri}"
2 changes: 1 addition & 1 deletion solara/server/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class MainSettings(pydantic.BaseSettings):
mode: str = "production"
tracer: bool = False
timing: bool = False
root_path: Optional[str] = None # e.g. /myapp/
root_path: Optional[str] = None # e.g. /myapp (without trailing slash)
base_url: str = "" # e.g. https://myapp.solara.run/myapp/
platform: str = sys.platform

Expand Down

0 comments on commit d4fb2a1

Please sign in to comment.