reflex-monad-auth-0.1.0.1: Utilities to split reflex app to authorized and not authorized contexts

Safe HaskellNone
LanguageHaskell2010

Reflex.Auth.Class

Synopsis

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.

Associated Types

type AuthInfo t m :: * Source #

Monad specific information about authorization

Methods

getAuthInfoRef :: m (ExternalRef t (Maybe (AuthInfo t m))) Source #

Get reference from context that tracks current state of authorization

liftAuth Source #

Arguments

:: 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.

Instances
(HasAuth t m, Monad m) => HasAuth t (ReaderT e m) Source # 
Instance details

Defined in Reflex.Auth.Class

Associated Types

type AuthInfo t (ReaderT e m) :: Type Source #

Methods

getAuthInfoRef :: ReaderT e m (ExternalRef t (Maybe (AuthInfo t (ReaderT e m)))) Source #

liftAuth :: ReaderT e m a -> ReaderT (AuthedEnv t (ReaderT e m)) (ReaderT e m) a -> ReaderT e m (Dynamic t a) Source #

(Eq info, Reflex t, MonadIO m, MonadHold t m, MonadFix m, Adjustable t m) => HasAuth t (AuthT info t m) Source # 
Instance details

Defined in Reflex.Auth.Trans

Associated Types

type AuthInfo t (AuthT info t m) :: Type Source #

Methods

getAuthInfoRef :: AuthT info t m (ExternalRef t (Maybe (AuthInfo t (AuthT info t m)))) Source #

liftAuth :: AuthT info t m a -> ReaderT (AuthedEnv t (AuthT info t m)) (AuthT info t m) a -> AuthT info t m (Dynamic t a) Source #

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 #

Get dynamic that is Nothing when is not authorized and Just when we have authorization.

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.

signout :: (HasAuth t m, PerformEvent t m, MonadIO m, MonadIO (Performable m)) => Event t () -> m (Event t ()) Source #

When input event is fired, the auth info inside is nullified and all liftAuth widgets are switched back to not authorized states.

signin :: (HasAuth t m, PerformEvent t m, MonadIO m, MonadIO (Performable m)) => Event t (AuthInfo t m) -> m (Event t (AuthInfo t m)) Source #

When input event is fired all liftAuth widgets switches to authorized states.