happstack-authenticate-0.9.2: Happstack Authentication Library

Safe HaskellSafe-Infered

Happstack.Auth.Blaze.Templates

Contents

Description

This modules provides templates and routing functions which can be used to integrate authentication into your site.

In most cases, you only need to call the handleAuth and hanldeProfile functions. The other functions are exported in case you wish to create your own alternatives to handleAuth / handleProfile

Synopsis

handlers

handleAuthSource

Arguments

:: (Happstack m, MonadRoute m, URL m ~ AuthURL) 
=> AcidState AuthState

database handle for AuthState

-> (String -> Html -> Html -> m Response)

page template function

-> Maybe Credentials

config information for facebook connect

-> Maybe Text

authentication realm

-> Text

URL to redirect to after succesful authentication

-> AuthURL

url to route

-> m Response 

Function which takes care of all AuthURL routes.

The caller provides a page template function which will be used to render pages. The provided page template function takes three arguments:

    String -- ^ string to use in the <title> tag
 -> Html   -- ^ extra headers to add to the <head> tag
 -> Html   -- ^ contents to stick in the <body> tag

handleProfileSource

Arguments

:: (Happstack m, Alternative m, MonadRoute m, URL m ~ ProfileURL) 
=> AcidState AuthState

database handle for AuthState

-> AcidState ProfileState

database handle for ProfileState

-> (String -> Html -> Html -> m Response)

page template function

-> Text

URL to redirect to after successfully picking an identity

-> ProfileURL

URL to route

-> m Response 

Function which takes care of all ProfileURL routes.

The caller provides a page template function which will be used to render pages. The provided page template function takes three arguments:

    String -- ^ string to use in the <title> tag
 -> Html   -- ^ extra headers to add to the <head> tag
 -> Html   -- ^ contents to stick in the <body> tag

page functions

liveJournalForm :: (Functor m, Monad m) => AuthForm m TextSource