feat(web/panettone): persist original-uri through failed auth

Even if the user fails to log in, maintain the original-uri param if
present, so that if they eventually succeed at logging in they still get
where they were originally trying to get.

Change-Id: I2faa5eced002ab899c803cf19095cea76897d92d
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1499
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
This commit is contained in:
Griffin Smith 2020-07-28 18:39:54 -04:00 committed by glittershark
parent f46aa2a20c
commit 14a8142f76

View file

@ -365,7 +365,8 @@ successful, `nil' otherwise"
(progn
(setf (hunchentoot:session-value 'user) user)
(hunchentoot:redirect (or original-uri "/")))
(render/login :message "Invalid credentials")))
(render/login :message "Invalid credentials"
:original-uri original-uri)))
(defroute logout ("/logout" :method :post) ()
(hunchentoot:delete-session-value 'user)