From: David ‘Bombe’ Roden Date: Tue, 30 Nov 2010 17:30:33 +0000 (+0100) Subject: Redirect to index page if the user is already logged in. X-Git-Tag: 0.3.2-RC3~1 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=feed7f41366c0d638e7c2b0d9f9ccbd1ee19927d;p=Sone.git Redirect to index page if the user is already logged in. --- 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 //