Source

snaplet-mongoDB / src / Snap / Snaplet / Auth / Backends / MongoDB.hs

Diff from to

File src/Snap/Snaplet/Auth/Backends/MongoDB.hs

   -- ^ Lens into a 'SessionManager' auth snaplet will use
   -> Snaplet MongoDBSnaplet
   -- ^ Lens into a 'MongoDBSnaplet'
+  -> Initializer b (AuthManager b) ()
+  -- ^ Custom action to run with normal snaplet init
   -> SnapletInit b (AuthManager b)
-initMongoDBAuthManager settings session_lens mongo =
+initMongoDBAuthManager settings session_lens mongo action =
   makeSnaplet "MongoDBAuthManager"
       "A snaplet providing user authentication using a MongoDB backend"
       Nothing $ do
+        action
         key  <- liftIO $ getKey (asSiteKey settings)
         return $ AuthManager {
             backend = MongoDBAuthManager mongo