This repository was archived by the owner on Apr 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,13 +10,14 @@ module Site
1010
1111------------------------------------------------------------------------------
1212import Control.Applicative
13+ import Control.Lens.Getter
1314import Data.ByteString (ByteString )
1415import Data.Monoid
1516import qualified Data.Text as T
1617import Snap.Core
1718import Snap.Snaplet
1819import Snap.Snaplet.Auth
19- import Snap.Snaplet.Auth.Backends.JsonFile
20+ import Snap.Snaplet.Auth.Backends.Persistent
2021import Snap.Snaplet.Persistent
2122import Snap.Snaplet.Heist
2223import Snap.Snaplet.Session.Backends.CookieSession
@@ -83,11 +84,8 @@ app = makeSnaplet "app" "An snaplet example application." Nothing $ do
8384
8485 p <- nestSnaplet " " db $ initPersist (runMigrationUnsafe migrateAll)
8586
86- -- NOTE: We're using initJsonFileAuthManager here because it's easy and
87- -- doesn't require any kind of database server to run. In practice,
88- -- you'll probably want to change this to a more robust auth backend.
89- a <- nestSnaplet " auth" auth $
90- initJsonFileAuthManager defAuthSettings sess " users.json"
87+ a <- nestSnaplet " auth" auth $ initPersistAuthManager sess (persistPool $ view snapletValue p)
88+
9189 addRoutes routes
9290 addAuthSplices h auth
9391 return $ App h s a p
You can’t perform that action at this time.
0 commit comments