Module

HTTPure.Contrib.Biscotti

Package
purescript-httpure-contrib-biscotti
Repository
drewolson/purescript-httpure-contrib-biscotti

#middleware Source

middleware :: forall a m. MonadAff m => EncodeJson a => DecodeJson a => String -> SessionStore a -> (Maybe a -> Request -> m (Tuple Response (Maybe a))) -> Request -> m Response

Create an HTTPure middleware for sesion handling. Requires the name of your cookie and a Biscotti.Session.SessionStore

launchAff_ do
  store <- liftEffect $ Session.memoryStore "_test"
  let middleware = Biscotti.middleware "_test" store

#middleware' Source

middleware' :: forall a m. MonadAff m => EncodeJson a => DecodeJson a => String -> SessionStore a -> ErrorHandler m -> CookieUpdater m -> (Maybe a -> Request -> m (Tuple Response (Maybe a))) -> Request -> m Response