Fix order_popup flag through SSO and hide stats in hub order popup.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1900,8 +1900,12 @@ def api_instance_open_url(
|
||||
next: str = "/",
|
||||
embed: str = "",
|
||||
hub_theme: str = "",
|
||||
order_popup: str = "",
|
||||
symbol: str = "",
|
||||
):
|
||||
"""已登录中控时生成实例 SSO 打开链接(2h 有效、单次使用,复用 HUB_BRIDGE_TOKEN)。"""
|
||||
from instance_embed_lib import merge_next_query
|
||||
|
||||
_require_hub_logged_in(request)
|
||||
if not HUB_BRIDGE_TOKEN:
|
||||
raise HTTPException(status_code=503, detail="未配置 HUB_BRIDGE_TOKEN,无法签发实例打开链接")
|
||||
@@ -1915,6 +1919,11 @@ def api_instance_open_url(
|
||||
if not ex_key:
|
||||
raise HTTPException(status_code=400, detail="该账户缺少 key(用于 SSO 校验)")
|
||||
nxt = safe_next_path(next)
|
||||
if (order_popup or "").strip().lower() in ("1", "true", "yes", "on"):
|
||||
nxt = merge_next_query(nxt, order_popup="1")
|
||||
sym = (symbol or "").strip()
|
||||
if sym:
|
||||
nxt = merge_next_query(nxt, symbol=sym)
|
||||
token = mint_hub_sso_token(ex_key, nxt)
|
||||
if not token:
|
||||
raise HTTPException(status_code=503, detail="签发 SSO 失败")
|
||||
|
||||
Reference in New Issue
Block a user