File tree 1 file changed +4
-6
lines changed
1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -10,13 +10,14 @@ module Site
10
10
11
11
------------------------------------------------------------------------------
12
12
import Control.Applicative
13
+ import Control.Lens.Getter
13
14
import Data.ByteString (ByteString )
14
15
import Data.Monoid
15
16
import qualified Data.Text as T
16
17
import Snap.Core
17
18
import Snap.Snaplet
18
19
import Snap.Snaplet.Auth
19
- import Snap.Snaplet.Auth.Backends.JsonFile
20
+ import Snap.Snaplet.Auth.Backends.Persistent
20
21
import Snap.Snaplet.Persistent
21
22
import Snap.Snaplet.Heist
22
23
import Snap.Snaplet.Session.Backends.CookieSession
@@ -83,11 +84,8 @@ app = makeSnaplet "app" "An snaplet example application." Nothing $ do
83
84
84
85
p <- nestSnaplet " " db $ initPersist (runMigrationUnsafe migrateAll)
85
86
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
+
91
89
addRoutes routes
92
90
addAuthSplices h auth
93
91
return $ App h s a p
You can’t perform that action at this time.
0 commit comments