- data Auth
- data AuthPlugin m = AuthPlugin {}
- data AuthRoute
- getAuth :: a -> Auth
- class (Yesod m, SinglePiece (AuthId m), RenderMessage m FormMessage) => YesodAuth m where
- type AuthId m
- loginDest :: m -> Route m
- logoutDest :: m -> Route m
- getAuthId :: Creds m -> GHandler s m (Maybe (AuthId m))
- authPlugins :: [AuthPlugin m]
- loginHandler :: GHandler Auth m RepHtml
- renderAuthMessage :: m -> [Text] -> AuthMessage -> Text
- redirectToReferer :: m -> Bool
- data Creds m = Creds {
- credsPlugin :: Text
- credsIdent :: Text
- credsExtra :: [(Text, Text)]
- setCreds :: YesodAuth m => Bool -> Creds m -> GHandler s m ()
- maybeAuthId :: YesodAuth m => GHandler s m (Maybe (AuthId m))
- maybeAuth :: (YesodAuth m, b ~ YesodPersistBackend m, Key b val ~ AuthId m, PersistBackend b (GGHandler s m IO), PersistEntity val, YesodPersist m) => GHandler s m (Maybe (Key b val, val))
- requireAuthId :: YesodAuth m => GHandler s m (AuthId m)
- requireAuth :: (YesodAuth m, b ~ YesodPersistBackend m, Key b val ~ AuthId m, PersistBackend b (GGHandler s m IO), PersistEntity val, YesodPersist m) => GHandler s m (Key b val, val)
Subsite
data AuthPlugin m Source
class (Yesod m, SinglePiece (AuthId m), RenderMessage m FormMessage) => YesodAuth m whereSource
loginDest :: m -> Route mSource
Default destination on successful login, if no other destination exists.
logoutDest :: m -> Route mSource
Default destination on successful logout, if no other destination exists.
getAuthId :: Creds m -> GHandler s m (Maybe (AuthId m))Source
authPlugins :: [AuthPlugin m]Source
loginHandler :: GHandler Auth m RepHtmlSource
What to show on the login page.
:: m | |
-> [Text] | languages |
-> AuthMessage | |
-> Text |
redirectToReferer :: m -> BoolSource
After login and logout, redirect to the referring page, instead of
loginDest
and logoutDest
. Default is False
.
Plugin interface
User credentials
Creds | |
|
setCreds :: YesodAuth m => Bool -> Creds m -> GHandler s m ()Source
FIXME: won't show up till redirect
User functions
maybeAuthId :: YesodAuth m => GHandler s m (Maybe (AuthId m))Source
Retrieves user credentials, if user is authenticated.
maybeAuth :: (YesodAuth m, b ~ YesodPersistBackend m, Key b val ~ AuthId m, PersistBackend b (GGHandler s m IO), PersistEntity val, YesodPersist m) => GHandler s m (Maybe (Key b val, val))Source
requireAuthId :: YesodAuth m => GHandler s m (AuthId m)Source
requireAuth :: (YesodAuth m, b ~ YesodPersistBackend m, Key b val ~ AuthId m, PersistBackend b (GGHandler s m IO), PersistEntity val, YesodPersist m) => GHandler s m (Key b val, val)Source