From f46aa2a20c9e1e3c3b89748af0ce8c950e13c14f Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Tue, 28 Jul 2020 18:38:27 -0400 Subject: feat(web/panettone): Redirect to original URL after login Add an original-uri query param to the target of the Log In link pointing at the current URL, so that when the user eventually successfully logs in they are redirected to the page they were originally on Fixes: #21 Change-Id: I75ed7b75fa00b1b09c8b26bf4dcf5bc6b6d7f53a Reviewed-on: https://cl.tvl.fyi/c/depot/+/1498 Tested-by: BuildkiteCI Reviewed-by: tazjin --- web/panettone/src/panettone.lisp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'web/panettone/src') diff --git a/web/panettone/src/panettone.lisp b/web/panettone/src/panettone.lisp index b85a2e91cc6f..3d1bf41b4a5c 100644 --- a/web/panettone/src/panettone.lisp +++ b/web/panettone/src/panettone.lisp @@ -105,7 +105,12 @@ successful, `nil' otherwise" :action "/logout" (:input :type "submit" :value "Log Out"))) (who:htm - (:a :href "/login" "Log In"))))))) + (:a :href + (format nil + "/login?original-uri=~A" + (drakma:url-encode (hunchentoot:request-uri*) + :utf-8)) + "Log In"))))))) (defmacro render ((&key (footer t)) &body body) `(who:with-html-output-to-string (*standard-output* nil :prologue t) -- cgit 1.4.1