Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- class (Eq (AuthInfo t m), Reflex t) => HasAuth t m | m -> t where
- type AuthInfo t m :: *
- getAuthInfoRef :: m (ExternalRef t (Maybe (AuthInfo t m)))
- liftAuth :: m a -> ReaderT (AuthedEnv t m) m a -> m (Dynamic t a)
- type AuthedEnv t m = Dynamic t (AuthInfo t m)
- getAuthInfoMay :: (HasAuth t m, MonadHold t m, MonadFix m, MonadIO m) => m (Dynamic t (Maybe (AuthInfo t m)))
- getLogged :: (HasAuth t m, MonadHold t m, MonadFix m, MonadIO m) => m (Dynamic t Bool)
- signout :: (HasAuth t m, PerformEvent t m, MonadIO m, MonadIO (Performable m)) => Event t () -> m (Event t ())
- signin :: (HasAuth t m, PerformEvent t m, MonadIO m, MonadIO (Performable m)) => Event t (AuthInfo t m) -> m (Event t (AuthInfo t m))
Documentation
class (Eq (AuthInfo t m), Reflex t) => HasAuth t m | m -> t where Source #
Monad for actions that can be authorizaed or not authorized.
getAuthInfoRef :: m (ExternalRef t (Maybe (AuthInfo t m))) Source #
Get reference from context that tracks current state of authorization
:: m a | Which widget to render when not authorized |
-> ReaderT (AuthedEnv t m) m a | Which widget to render when authorized |
-> m (Dynamic t a) |
A typical way to perform one action when user logged and perform another FRP network part when the user is authorized.
type AuthedEnv t m = Dynamic t (AuthInfo t m) Source #
Environment that holds changing authorization information
getAuthInfoMay :: (HasAuth t m, MonadHold t m, MonadFix m, MonadIO m) => m (Dynamic t (Maybe (AuthInfo t m))) Source #
getLogged :: (HasAuth t m, MonadHold t m, MonadFix m, MonadIO m) => m (Dynamic t Bool) Source #
Return dynamic that indicates whether we in authorized or in authorized state.