diff --git a/packages/solara-enterprise/solara_enterprise/auth/utils.py b/packages/solara-enterprise/solara_enterprise/auth/utils.py index 0e51d9bb0..3f3b6d37f 100644 --- a/packages/solara-enterprise/solara_enterprise/auth/utils.py +++ b/packages/solara-enterprise/solara_enterprise/auth/utils.py @@ -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}" diff --git a/solara/server/settings.py b/solara/server/settings.py index 51adaa834..7a970df0d 100644 --- a/solara/server/settings.py +++ b/solara/server/settings.py @@ -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