Safe Haskell | None |
---|---|
Language | Haskell98 |
Snap.Snaplet.CustomAuth
Documentation
data AuthManager u e b Source #
Constructors
IAuthBackend u i e b => AuthManager | |
Fields
|
Constructors
AuthUser | |
Fields
|
data AuthFailure e Source #
Constructors
UserError e | |
Login LoginFailure | |
Create CreateFailure |
Instances
Show e => Show (AuthFailure e) Source # | |
data LoginFailure Source #
Instances
data CreateFailure Source #
Constructors
MissingName | |
InvalidName | |
DuplicateName | |
PasswordFailure PasswordFailure | |
OAuth2Failure OAuth2Failure |
Instances
data PasswordFailure Source #
Instances
class (UserData u, Binary i, Show e, Eq e) => IAuthBackend u i e b | u -> b, b -> e, e -> i where Source #
Minimal complete definition
preparePasswordCreate, cancelPrepare, create, attachLoginMethod, login, logout, recover, getUserId, isDuplicateError
Methods
preparePasswordCreate :: Maybe u -> Text -> Handler b (AuthManager u e b) (Either e i) Source #
cancelPrepare :: i -> Handler b (AuthManager u e b) () Source #
create :: Text -> i -> Handler b (AuthManager u e b) (Either (Either e CreateFailure) u) Source #
attachLoginMethod :: u -> i -> Handler b (AuthManager u e b) (Either e ()) Source #
login :: Text -> Text -> Handler b (AuthManager u e b) (Either e (Maybe u)) Source #
logout :: Text -> Handler b (AuthManager u e b) () Source #
recover :: Text -> Handler b (AuthManager u e b) (Either (AuthFailure e) u) Source #
getUserId :: u -> Handler b (AuthManager u e b) ByteString Source #
isDuplicateError :: e -> Handler b (AuthManager u e b) Bool Source #
class UserData a where Source #
Minimal complete definition
Methods
extractUser :: a -> AuthUser Source #
defAuthSettings :: AuthSettings Source #
authSetCookie :: Lens' AuthSettings (ByteString -> Cookie) Source #
createAccount :: IAuthBackend u i e b => Handler b (AuthManager u e b) (Either (Either e CreateFailure) u) Source #
loginUser :: IAuthBackend u i e b => Handler b (AuthManager u e b) () -> Handler b (AuthManager u e b) () -> Handler b (AuthManager u e b) () Source #
logoutUser :: IAuthBackend u i e b => Handler b (AuthManager u e b) () Source #
recoverSession :: IAuthBackend u i e b => Handler b (AuthManager u e b) () Source #
combinedLoginRecover :: IAuthBackend u i e b => Handler b (AuthManager u e b) () -> Handler b (AuthManager u e b) (Maybe u) Source #
currentUser :: UserData u => Handler b (AuthManager u e b) (Maybe u) Source #
getAuthFailData :: Handler b (AuthManager u e b) (Maybe (AuthFailure e)) Source #
resetAuthFailData :: Handler b (AuthManager u e b) () Source #
authInit :: IAuthBackend u i e b => Maybe (OAuth2Settings u i e b) -> AuthSettings -> SnapletInit b (AuthManager u e b) Source #
isSessionDefined :: Handler b (AuthManager u e b) Bool Source #
isLoggedIn :: UserData u => Handler b (AuthManager u e b) Bool Source #
compiledAuthSplices :: UserData u => SnapletLens b (AuthManager u e b) -> Splices (SnapletCSplice b) Source #
ifLoggedIn :: UserData u => SnapletLens b (AuthManager u e b) -> SnapletISplice b Source #
ifLoggedOut :: UserData u => SnapletLens b (AuthManager u e b) -> SnapletISplice b Source #
loggedInUser :: UserData u => SnapletLens b (AuthManager u e b) -> SnapletISplice b Source #