From 9024f49ca63d0e7204bf61de5b06717e2ee6a1e6 Mon Sep 17 00:00:00 2001 From: Jesse Morgan Date: Mon, 3 Jun 2013 18:30:46 -0700 Subject: Adding Login logic and updating navigation. Adding a LoginAuthenticator to parse session cookies and a LoginPageResource to handle submissions to the login page. Also updating the navigation header to show Take Assessment when the user is authenticated. --- src/com/p4square/grow/frontend/GrowFrontend.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/com/p4square/grow/frontend/GrowFrontend.java') diff --git a/src/com/p4square/grow/frontend/GrowFrontend.java b/src/com/p4square/grow/frontend/GrowFrontend.java index 7283ea1..85b223b 100644 --- a/src/com/p4square/grow/frontend/GrowFrontend.java +++ b/src/com/p4square/grow/frontend/GrowFrontend.java @@ -24,6 +24,19 @@ import net.jesterpm.fmfacade.FreeMarkerPageResource; public class GrowFrontend extends FMFacade { private static Logger cLog = Logger.getLogger(GrowFrontend.class); + @Override + protected Router createRouter() { + Router router = new Router(getContext()); + + final LoginAuthenticator defaultGuard = + new LoginAuthenticator(getContext(), true, "login.html"); + defaultGuard.setNext(FreeMarkerPageResource.class); + router.attachDefault(defaultGuard); + router.attach("/login.html", LoginPageResource.class); + + return router; + } + /** * Stand-alone main for testing. */ -- cgit v1.2.3