From 337ae2c91fb3821db0c45a157ef8d612e78ab6a0 Mon Sep 17 00:00:00 2001 From: Kaustubh Maske Patil <37668193+nikochiko@users.noreply.github.com> Date: Tue, 17 Dec 2024 18:32:33 +0530 Subject: [PATCH 1/3] fix next URL on tapping 'Sign In' - should include query params --- routers/root.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/routers/root.py b/routers/root.py index 06398d3b6..834d9502e 100644 --- a/routers/root.py +++ b/routers/root.py @@ -772,7 +772,8 @@ def page_wrapper(request: Request, className=""): def anonymous_login_container(request: Request, context: dict): - login_url = str(furl("/login/", query_params=dict(next=request.url.path))) + next_url = str(furl(request.url.path).add(query_params=request.query_params)) + login_url = str(furl("/login/", query_params=dict(next=next_url))) with gui.tag("a", href=login_url, className="pe-2 d-none d-lg-block"): gui.html("Sign In") From 488fe4ea635d7c076fe8a531be4de7b4f34f92de Mon Sep 17 00:00:00 2001 From: Kaustubh Maske Patil <37668193+nikochiko@users.noreply.github.com> Date: Tue, 17 Dec 2024 18:35:25 +0530 Subject: [PATCH 2/3] use similar style to set query_params as in other places --- routers/root.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routers/root.py b/routers/root.py index 834d9502e..961b4deb3 100644 --- a/routers/root.py +++ b/routers/root.py @@ -772,7 +772,7 @@ def page_wrapper(request: Request, className=""): def anonymous_login_container(request: Request, context: dict): - next_url = str(furl(request.url.path).add(query_params=request.query_params)) + next_url = str(furl(request.url.path, query_params=request.query_params)) login_url = str(furl("/login/", query_params=dict(next=next_url))) with gui.tag("a", href=login_url, className="pe-2 d-none d-lg-block"): From b5468245411fe6cf7602b17410282cf295291655 Mon Sep 17 00:00:00 2001 From: Kaustubh Maske Patil <37668193+nikochiko@users.noreply.github.com> Date: Wed, 18 Dec 2024 11:33:32 +0530 Subject: [PATCH 3/3] use furl(...).set(origin=None) to clear out origin from URL --- routers/root.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routers/root.py b/routers/root.py index 961b4deb3..5688f8807 100644 --- a/routers/root.py +++ b/routers/root.py @@ -772,7 +772,7 @@ def page_wrapper(request: Request, className=""): def anonymous_login_container(request: Request, context: dict): - next_url = str(furl(request.url.path, query_params=request.query_params)) + next_url = str(furl(request.url).set(origin=None)) login_url = str(furl("/login/", query_params=dict(next=next_url))) with gui.tag("a", href=login_url, className="pe-2 d-none d-lg-block"):