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 <mail@tazj.in>
This commit is contained in:
Griffin Smith 2020-07-28 18:38:27 -04:00 committed by glittershark
parent addcba11b0
commit f46aa2a20c

View file

@ -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)