feat: add light/dark theme to exchange instances with hub SSO sync
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1057,7 +1057,11 @@ def _require_hub_logged_in(request: Request) -> None:
|
||||
|
||||
@app.get("/api/instance/open-url")
|
||||
def api_instance_open_url(
|
||||
request: Request, exchange_id: str, next: str = "/", embed: str = ""
|
||||
request: Request,
|
||||
exchange_id: str,
|
||||
next: str = "/",
|
||||
embed: str = "",
|
||||
hub_theme: str = "",
|
||||
):
|
||||
"""已登录中控时生成实例 SSO 打开链接(2h 有效、单次使用,复用 HUB_BRIDGE_TOKEN)。"""
|
||||
_require_hub_logged_in(request)
|
||||
@@ -1079,6 +1083,9 @@ def api_instance_open_url(
|
||||
params = {"token": token, "next": nxt}
|
||||
if (embed or "").strip().lower() in ("1", "true", "yes", "on"):
|
||||
params["embed"] = "1"
|
||||
ht = (hub_theme or "").strip().lower()
|
||||
if ht in ("light", "dark"):
|
||||
params["hub_theme"] = ht
|
||||
q = urlencode(params)
|
||||
return {
|
||||
"ok": True,
|
||||
|
||||
Reference in New Issue
Block a user