From 92bd7b80c80c5f02cf0c35b3fd5ba201f888a01e Mon Sep 17 00:00:00 2001 From: --unset Date: Tue, 16 Apr 2024 10:26:09 -0400 Subject: [PATCH 1/3] Remove console log on login --- app/frontend/templates/public/login.html | 1 - 1 file changed, 1 deletion(-) diff --git a/app/frontend/templates/public/login.html b/app/frontend/templates/public/login.html index 275d2000..9c7d3f91 100644 --- a/app/frontend/templates/public/login.html +++ b/app/frontend/templates/public/login.html @@ -171,7 +171,6 @@ //Create an object from the form data entries let formDataObject = Object.fromEntries(formData.entries()); - console.log(formDataObject) let res = await fetch(`/login`, { method: 'POST', headers: { From 89b552a880b16b0bc786f46034677b9ef3f896da Mon Sep 17 00:00:00 2001 From: --unset Date: Tue, 16 Apr 2024 10:26:32 -0400 Subject: [PATCH 2/3] Redirect to /login if garbage is in query args --- app/classes/web/public_handler.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/classes/web/public_handler.py b/app/classes/web/public_handler.py index 21e2d495..a3d89d25 100644 --- a/app/classes/web/public_handler.py +++ b/app/classes/web/public_handler.py @@ -48,7 +48,10 @@ class PublicHandler(BaseHandler): } if self.request.query: - page_data["query"] = self.request.query_arguments.get("next")[0].decode() + request_query = self.request.query_arguments.get("next") + if not request_query: + self.redirect("/login") + page_data["query"] = request_query[0].decode() # sensible defaults template = "public/404.html" From 4cd3bf17aed7ae55202ca59f1c6bdc5319c96aaf Mon Sep 17 00:00:00 2001 From: Zedifus Date: Thu, 9 May 2024 20:58:26 +0100 Subject: [PATCH 3/3] Update changelog !750 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a72bbc60..6197feba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ ### New features TBD ### Bug fixes -TBD +- Reset query arguments on login if `?next` is not available ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/750)) ### Tweaks - Add link to go back to dashboard on error page ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/743)) ### Lang