Store cross-app cart_sid on login for cart adoption
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 58s

Read cart_sid from query params on login page and save to session
so the verify route can emit adoption event with the correct session.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
giles
2026-02-22 17:46:27 +00:00
parent 78fb9d8dd8
commit 1a8a5f4487
2 changed files with 5 additions and 1 deletions

View File

@@ -78,6 +78,10 @@ def register(url_prefix="/auth"):
@auth_bp.get("/login/")
async def login_form():
store_login_redirect_target()
# Preserve anonymous cart session from cross-app redirect
cross_cart_sid = request.args.get("cart_sid")
if cross_cart_sid:
qsession["cart_sid"] = cross_cart_sid
if g.get("user"):
return redirect(coop_url("/"))
return await render_template("_types/auth/login.html")

2
shared

Submodule shared updated: 07aa2e2be9...1c1ab3576f