]> WPIA git - gigi.git/commitdiff
fix: redirect-back after login
authorFelix Dörre <felix@dogcraft.de>
Thu, 15 Sep 2016 18:34:36 +0000 (20:34 +0200)
committerFelix Dörre <felix@dogcraft.de>
Thu, 15 Sep 2016 18:34:36 +0000 (20:34 +0200)
Change-Id: Ib416aed3f5c64909593172dcaa378fbcbd59c183

src/org/cacert/gigi/pages/LoginPage.java

index 69b05887bb0babd9d381603504031e8cccb55d2e..e4aa2e744ad008da66724da8278540dccdb07cfa 100644 (file)
@@ -96,7 +96,7 @@ public class LoginPage extends Page {
     }
 
     private static String redirectPath(HttpServletRequest req) {
     }
 
     private static String redirectPath(HttpServletRequest req) {
-        String redir = (String) req.getSession().getAttribute(LOGIN_RETURNPATH);
+        String redir = (String) req.getAttribute(LOGIN_RETURNPATH);
         String s = redir;
         if (s != null) {
             if ( !s.startsWith("/")) {
         String s = redir;
         if (s != null) {
             if ( !s.startsWith("/")) {
@@ -194,6 +194,7 @@ public class LoginPage extends Page {
         if (user.isInGroup(LOGIN_BLOCKED)) {
             return;
         }
         if (user.isInGroup(LOGIN_BLOCKED)) {
             return;
         }
+        req.setAttribute(LOGIN_RETURNPATH, req.getSession().getAttribute(LOGIN_RETURNPATH));
         req.getSession().invalidate();
         HttpSession hs = req.getSession();
         hs.setAttribute(LOGGEDIN, true);
         req.getSession().invalidate();
         HttpSession hs = req.getSession();
         hs.setAttribute(LOGGEDIN, true);