From 8e3675865d7bf0fd9eec311dfb7fafc3ae4eedb2 Mon Sep 17 00:00:00 2001 From: fr33domlover Date: Wed, 17 Feb 2016 11:31:01 +0000 Subject: [PATCH] Add comment bits for SSL and delete some garbage from template --- src/Foundation.hs | 12 ++++++++---- templates/default-layout-wrapper.hamlet | 11 ++--------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/Foundation.hs b/src/Foundation.hs index accb7e9..b437a4d 100644 --- a/src/Foundation.hs +++ b/src/Foundation.hs @@ -69,9 +69,10 @@ instance Yesod App where -- Store session data on the client in encrypted cookies, -- default session idle timeout is 120 minutes - makeSessionBackend _ = Just <$> defaultClientSessionBackend - 120 -- timeout in minutes - "config/client_session_key.aes" + makeSessionBackend _ = + -- sslOnlySessions $ + Just <$> + defaultClientSessionBackend 120 "config/client_session_key.aes" -- Yesod Middleware allows you to run code before and after each handler function. -- The defaultYesodMiddleware adds the response header "Vary: Accept, Accept-Language" and performs authorization checks. @@ -79,7 +80,10 @@ instance Yesod App where -- a) Sets a cookie with a CSRF token in it. -- b) Validates that incoming write requests include that token in either a header or POST parameter. -- For details, see the CSRF documentation in the Yesod.Core.Handler module of the yesod-core package. - yesodMiddleware = defaultCsrfMiddleware . defaultYesodMiddleware + yesodMiddleware = + defaultCsrfMiddleware . + -- sslOnlyMiddleware 120 . + defaultYesodMiddleware defaultLayout widget = do master <- getYesod diff --git a/templates/default-layout-wrapper.hamlet b/templates/default-layout-wrapper.hamlet index 46ccae9..07ec4c9 100644 --- a/templates/default-layout-wrapper.hamlet +++ b/templates/default-layout-wrapper.hamlet @@ -1,10 +1,6 @@ $newline never -\ -\ -\ -\ -\ - + + @@ -16,9 +12,6 @@ $newline never ^{pageHead pc} - \