Redirect to index page if the user is already logged in.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 30 Nov 2010 17:30:33 +0000 (18:30 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 30 Nov 2010 17:30:33 +0000 (18:30 +0100)
src/main/java/net/pterodactylus/sone/web/LoginPage.java

index 6c3e5c5..c34d8ca 100644 (file)
@@ -78,6 +78,17 @@ public class LoginPage extends SoneTemplatePage {
                template.set("identitiesWithoutSone", ownIdentitiesWithoutSone);
        }
 
+       /**
+        * {@inheritDoc}
+        */
+       @Override
+       protected String getRedirectTarget(Request request) {
+               if (getCurrentSone(request.getToadletContext()) != null) {
+                       return "index.html";
+               }
+               return null;
+       }
+
        //
        // SONETEMPLATEPAGE METHODS
        //