Commits

Luke Plant  committed 3613bec

Made login view look at 'r' query parameter for redirction URL

  • Participants
  • Parent commits d8bd68e

Comments (0)

Files changed (1)

File src/Blog/Views.hs

 standardResponseTT req template =
     let csrffield = mkCsrfField req
         t2 = setAttribute "csrffield" csrffield template
-        rendered = render t2
+        t3 = setAttribute "currentpath" (Settings.root_url ++ pathInfo req) t2
+        rendered = render t3
     in buildResponse [ addContent rendered
                      ] utf8HtmlResponse
 
          then do
            ts <- getTimestamp
            let loginCookies = createLoginCookies loginData ts
-           return $ Just $ (redirectResponse adminMenuUrl) `with` (map addCookie loginCookies)
+           let redirectUrl = getGET req "r" `captureOrDefault` adminMenuUrl
+           return $ Just $ (redirectResponse redirectUrl) `with` (map addCookie loginCookies)
          else do
            t <- loginTemplate
            return $ Just $ standardResponseTT req $ loginPage t loginData loginErrors