diff options
author | Jesse Morgan <jesse@jesterpm.net> | 2013-06-03 18:30:46 -0700 |
---|---|---|
committer | Jesse Morgan <jesse@jesterpm.net> | 2013-06-03 18:30:46 -0700 |
commit | 9024f49ca63d0e7204bf61de5b06717e2ee6a1e6 (patch) | |
tree | 70526506fc982ddb84317966f7d7bcdd878b47d9 /src/com/p4square/grow/frontend/GrowFrontend.java | |
parent | ee39f861d7a5147a8292647488b7dfc0cbeb1cce (diff) |
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.
Diffstat (limited to 'src/com/p4square/grow/frontend/GrowFrontend.java')
-rw-r--r-- | src/com/p4square/grow/frontend/GrowFrontend.java | 13 |
1 files changed, 13 insertions, 0 deletions
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. */ |