From feed7f41366c0d638e7c2b0d9f9ccbd1ee19927d Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Tue, 30 Nov 2010 18:30:33 +0100 Subject: [PATCH] Redirect to index page if the user is already logged in. --- src/main/java/net/pterodactylus/sone/web/LoginPage.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/java/net/pterodactylus/sone/web/LoginPage.java b/src/main/java/net/pterodactylus/sone/web/LoginPage.java index 6c3e5c5..c34d8ca 100644 --- a/src/main/java/net/pterodactylus/sone/web/LoginPage.java +++ b/src/main/java/net/pterodactylus/sone/web/LoginPage.java @@ -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 // -- 2.7.4