Safe Haskell | None |
---|---|
Language | Haskell2010 |
- module Model.Identity.Types
- determineIdentity :: (MonadHas Secret c m, MonadHasRequest c m, MonadDB c m) => m Identity
- maybeIdentity :: MonadHasIdentity c m => m a -> (Session -> m a) -> m a
- identityJSON :: ToObject o => Identity -> Record (Id Party) o
Documentation
module Model.Identity.Types
determineIdentity :: (MonadHas Secret c m, MonadHasRequest c m, MonadDB c m) => m Identity Source #
Extract session token from cookie, and use it to find an active session.
This is web framework code, and should NOT be used within application logic.
TODO: Make this more plain, taking the Secret and Request (or just the cookies) as regular arguments.
:: MonadHasIdentity c m | |
=> m a | Default action |
-> (Session -> m a) | Monadic function |
-> m a | Result |
Takes default action and a monadic function. If the Identity within the
monadic context is Identified
, apply the function to the Session
held
within. Otherwise, run the default action.