diff options
author | Joris Guyonvarch | 2015-07-18 17:36:35 +0200 |
---|---|---|
committer | Joris Guyonvarch | 2015-07-18 17:36:35 +0200 |
commit | b27a7914993f5a5a87160dc33431a6fa1f4ad323 (patch) | |
tree | 656447c17b61c0449fed21ef383c8910be365a79 /src/server/Application.hs | |
parent | 89dd4de13896f8e37d1bf133080eb881ab42b292 (diff) |
Securing the index page with the login session
Diffstat (limited to 'src/server/Application.hs')
-rw-r--r-- | src/server/Application.hs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/server/Application.hs b/src/server/Application.hs index 377d1ff..b83273f 100644 --- a/src/server/Application.hs +++ b/src/server/Application.hs @@ -28,14 +28,19 @@ import qualified Data.Text.Lazy as TL import qualified LoginSession +import qualified Secure + import Model.Database (runDb) import Model.User import Model.Payment import View.Page (page) + getIndexAction :: ActionM () -getIndexAction = do - html $ page +getIndexAction = + Secure.loggedAction (\_ -> + html $ page + ) getUsersAction :: ActionM () getUsersAction = do @@ -69,8 +74,8 @@ insertPaymentAction email name cost = do html "Not found" signIn :: Text -> ActionM () -signIn value = do - LoginSession.put value +signIn login = do + LoginSession.put login html "Ok" checkConnection :: ActionM () |