Fix redirection after successfull login.
authorFelix Dörre <felix@dogcraft.de>
Sat, 5 Jul 2014 22:35:56 +0000 (00:35 +0200)
committerFelix Dörre <felix@dogcraft.de>
Sat, 5 Jul 2014 22:35:56 +0000 (00:35 +0200)
src/org/cacert/gigi/pages/LoginPage.java

index acfc8f51ed310153e9f1d041402167599d91e35d..7febf2e5d5da3ff0b68ec0d05f3b0beb70e0d0c0 100644 (file)
@@ -37,6 +37,7 @@ public class LoginPage extends Page {
        @Override
        public boolean beforeTemplate(HttpServletRequest req,
                        HttpServletResponse resp) throws IOException {
+               String redir = (String) req.getSession().getAttribute(LOGIN_RETURNPATH);
                if (req.getSession().getAttribute("loggedin") == null) {
                        X509Certificate[] cert = (X509Certificate[]) req
                                        .getAttribute("javax.servlet.request.X509Certificate");
@@ -49,7 +50,7 @@ public class LoginPage extends Page {
                }
 
                if (req.getSession().getAttribute("loggedin") != null) {
-                       String s = (String) req.getSession().getAttribute(LOGIN_RETURNPATH);
+                       String s = redir;
                        if (s != null) {
                                if (!s.startsWith("/")) {
                                        s = "/" + s;