Compare commits
1 Commits
07aa2e2be9
...
1c1ab3576f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1c1ab3576f |
@@ -67,8 +67,16 @@ def market_product_url(product_slug: str, suffix: str = "", market_place=None) -
|
||||
|
||||
def login_url(next_url: str = "") -> str:
|
||||
# Auth lives in blog (coop) for now. Set AUTH_APP=federation to switch.
|
||||
from quart import session as qsession
|
||||
auth_app = os.getenv("AUTH_APP", "coop")
|
||||
base = app_url(auth_app, "/auth/login/")
|
||||
params: list[str] = []
|
||||
if next_url:
|
||||
return f"{base}?next={quote(next_url, safe='')}"
|
||||
params.append(f"next={quote(next_url, safe='')}")
|
||||
# Pass anonymous cart session so the auth app can adopt it on login
|
||||
cart_sid = qsession.get("cart_sid")
|
||||
if cart_sid:
|
||||
params.append(f"cart_sid={quote(cart_sid, safe='')}")
|
||||
if params:
|
||||
return f"{base}?{'&'.join(params)}"
|
||||
return base
|
||||
|
||||
Reference in New Issue
Block a user