yesod-auth-0.7.7.1: Authentication for Yesod.

Yesod.Auth

Contents

Synopsis

Subsite

data Auth Source

Instances

(Yesod master, YesodAuth master) => YesodDispatch Auth master 

data AuthPlugin m Source

Constructors

AuthPlugin 

Fields

apName :: Text
 
apDispatch :: Method -> [Piece] -> GHandler Auth m ()
 
apLogin :: forall s. (Route Auth -> Route m) -> GWidget s m ()
 

class (Yesod m, SinglePiece (AuthId m), RenderMessage m FormMessage) => YesodAuth m whereSource

Associated Types

type AuthId m Source

Methods

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.

renderAuthMessageSource

Arguments

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

data Creds m Source

User credentials

Constructors

Creds 

Fields

credsPlugin :: Text

How the user was authenticated

credsIdent :: Text

Identifier. Exact meaning depends on plugin.

credsExtra :: [(Text, Text)]
 

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.