thentos-cookie-session-0.9.0: All-in-one session handling for servant-based frontends

Safe HaskellNone
LanguageHaskell2010

Thentos.CookieSession

Contents

Synopsis

Documentation

serveFAction :: forall api m s e v. (HasServer api `[]`, Enter (ServerT api m) (m :~> ExceptT ServantErr IO) (Server api), MonadRandom m, MonadError500 e m, MonadHasSessionCsrfToken s m, MonadViewCsrfSecret v m, MonadUseThentosSessionToken s m) => Proxy api -> Proxy s -> SetCookie -> ExtendClearanceOnSessionToken m -> (IO :~> m) -> (m :~> ExceptT ServantErr IO) -> ServerT api m -> IO Application Source

enterFAction :: (MonadRandom m, MonadError500 e m, MonadHasSessionCsrfToken s m, MonadViewCsrfSecret v m, MonadUseThentosSessionToken s m) => FSessionKey s -> FSessionMap s -> ExtendClearanceOnSessionToken m -> (IO :~> m) -> (m :~> ExceptT ServantErr IO) -> m :~> ExceptT ServantErr IO Source

types

data SSession m k v Source

SSession m k v represents a session storage with keys of type k, values of type v, and operating under the monad m. The underlying implementation uses the 'wai-session' package, and any backend compatible with that package should work here too.

Instances

HasServer * sublayout context => HasServer * ((:>) * * (SSession n k v) sublayout) context Source

HasServer instance for SSession.

type ServerT * ((:>) * * (SSession n k v) sublayout) m = (Key (Session n k v) -> Maybe (Session n k v)) -> ServerT * sublayout m Source 

type FSession fsd = Session IO () fsd Source

type FSessionMap fsd = Key (FSession fsd) -> Maybe (FSession fsd) Source

type FSessionStore fsd = SessionStore IO () fsd Source

type FServantSession fsd = SSession IO () fsd Source

type FSessionKey fsd = Key (FSession fsd) Source