Fix since markup
This commit is contained in:
parent
663220f334
commit
aff72a7365
@ -85,7 +85,7 @@ type Piece = Text
|
|||||||
|
|
||||||
-- | The result of an authentication based on credentials
|
-- | The result of an authentication based on credentials
|
||||||
--
|
--
|
||||||
-- Since 1.4.4
|
-- @since 1.4.4
|
||||||
data AuthenticationResult master
|
data AuthenticationResult master
|
||||||
= Authenticated (AuthId master) -- ^ Authenticated successfully
|
= Authenticated (AuthId master) -- ^ Authenticated successfully
|
||||||
| UserError AuthMessage -- ^ Invalid credentials provided by user
|
| UserError AuthMessage -- ^ Invalid credentials provided by user
|
||||||
@ -126,7 +126,7 @@ class (Yesod master, PathPiece (AuthId master), RenderMessage master FormMessage
|
|||||||
--
|
--
|
||||||
-- Default implementation is in terms of @'getAuthId'@
|
-- Default implementation is in terms of @'getAuthId'@
|
||||||
--
|
--
|
||||||
-- Since: 1.4.4
|
-- @since 1.4.4
|
||||||
authenticate :: Creds master -> HandlerT master IO (AuthenticationResult master)
|
authenticate :: Creds master -> HandlerT master IO (AuthenticationResult master)
|
||||||
authenticate creds = do
|
authenticate creds = do
|
||||||
muid <- getAuthId creds
|
muid <- getAuthId creds
|
||||||
@ -212,7 +212,7 @@ class (Yesod master, PathPiece (AuthId master), RenderMessage master FormMessage
|
|||||||
-- especially useful for creating an API to be accessed via some means
|
-- especially useful for creating an API to be accessed via some means
|
||||||
-- other than a browser.
|
-- other than a browser.
|
||||||
--
|
--
|
||||||
-- Since 1.2.0
|
-- @since 1.2.0
|
||||||
maybeAuthId :: HandlerT master IO (Maybe (AuthId master))
|
maybeAuthId :: HandlerT master IO (Maybe (AuthId master))
|
||||||
|
|
||||||
default maybeAuthId
|
default maybeAuthId
|
||||||
@ -243,7 +243,7 @@ class (Yesod master, PathPiece (AuthId master), RenderMessage master FormMessage
|
|||||||
|
|
||||||
-- | Internal session key used to hold the authentication information.
|
-- | Internal session key used to hold the authentication information.
|
||||||
--
|
--
|
||||||
-- Since 1.2.3
|
-- @since 1.2.3
|
||||||
credsKey :: Text
|
credsKey :: Text
|
||||||
credsKey = "_ID"
|
credsKey = "_ID"
|
||||||
|
|
||||||
@ -253,7 +253,7 @@ credsKey = "_ID"
|
|||||||
-- 'maybeAuthIdRaw' for more information. The first call in a request
|
-- 'maybeAuthIdRaw' for more information. The first call in a request
|
||||||
-- does a database request to make sure that the account is still in the database.
|
-- does a database request to make sure that the account is still in the database.
|
||||||
--
|
--
|
||||||
-- Since 1.1.2
|
-- @since 1.1.2
|
||||||
defaultMaybeAuthId
|
defaultMaybeAuthId
|
||||||
:: (YesodAuthPersist master, Typeable (AuthEntity master))
|
:: (YesodAuthPersist master, Typeable (AuthEntity master))
|
||||||
=> HandlerT master IO (Maybe (AuthId master))
|
=> HandlerT master IO (Maybe (AuthId master))
|
||||||
@ -278,7 +278,7 @@ cachedAuth
|
|||||||
-- This is the default 'loginHandler'. It concatenates plugin widgets and
|
-- This is the default 'loginHandler'. It concatenates plugin widgets and
|
||||||
-- wraps the result in 'authLayout'. See 'loginHandler' for more details.
|
-- wraps the result in 'authLayout'. See 'loginHandler' for more details.
|
||||||
--
|
--
|
||||||
-- Since 1.4.9
|
-- @since 1.4.9
|
||||||
defaultLoginHandler :: AuthHandler master Html
|
defaultLoginHandler :: AuthHandler master Html
|
||||||
defaultLoginHandler = do
|
defaultLoginHandler = do
|
||||||
tp <- getRouteToParent
|
tp <- getRouteToParent
|
||||||
@ -399,7 +399,7 @@ authLayoutJson w json = selectRep $ do
|
|||||||
|
|
||||||
-- | Clears current user credentials for the session.
|
-- | Clears current user credentials for the session.
|
||||||
--
|
--
|
||||||
-- Since 1.1.7
|
-- @since 1.1.7
|
||||||
clearCreds :: YesodAuth master
|
clearCreds :: YesodAuth master
|
||||||
=> Bool -- ^ if HTTP redirect to 'logoutDest' should be done
|
=> Bool -- ^ if HTTP redirect to 'logoutDest' should be done
|
||||||
-> HandlerT master IO ()
|
-> HandlerT master IO ()
|
||||||
@ -458,7 +458,7 @@ handlePluginR plugin pieces = do
|
|||||||
-- with the user\'s database identifier to get the value in the database. This
|
-- with the user\'s database identifier to get the value in the database. This
|
||||||
-- assumes that you are using a Persistent database.
|
-- assumes that you are using a Persistent database.
|
||||||
--
|
--
|
||||||
-- Since 1.1.0
|
-- @since 1.1.0
|
||||||
maybeAuth :: ( YesodAuthPersist master
|
maybeAuth :: ( YesodAuthPersist master
|
||||||
, val ~ AuthEntity master
|
, val ~ AuthEntity master
|
||||||
, Key val ~ AuthId master
|
, Key val ~ AuthId master
|
||||||
@ -472,7 +472,7 @@ maybeAuth = runMaybeT $ do
|
|||||||
-- | Similar to 'maybeAuth', but doesn’t assume that you are using a
|
-- | Similar to 'maybeAuth', but doesn’t assume that you are using a
|
||||||
-- Persistent database.
|
-- Persistent database.
|
||||||
--
|
--
|
||||||
-- Since 1.4.0
|
-- @since 1.4.0
|
||||||
maybeAuthPair :: (YesodAuthPersist master, Typeable (AuthEntity master))
|
maybeAuthPair :: (YesodAuthPersist master, Typeable (AuthEntity master))
|
||||||
=> HandlerT master IO (Maybe (AuthId master, AuthEntity master))
|
=> HandlerT master IO (Maybe (AuthId master, AuthEntity master))
|
||||||
maybeAuthPair = runMaybeT $ do
|
maybeAuthPair = runMaybeT $ do
|
||||||
@ -493,7 +493,7 @@ newtype CachedMaybeAuth val = CachedMaybeAuth { unCachedMaybeAuth :: Maybe val }
|
|||||||
-- given value. This is the common case in Yesod, and means that you can
|
-- given value. This is the common case in Yesod, and means that you can
|
||||||
-- easily look up the full information on a given user.
|
-- easily look up the full information on a given user.
|
||||||
--
|
--
|
||||||
-- Since 1.4.0
|
-- @since 1.4.0
|
||||||
class (YesodAuth master, YesodPersist master) => YesodAuthPersist master where
|
class (YesodAuth master, YesodPersist master) => YesodAuthPersist master where
|
||||||
-- | If the @AuthId@ for a given site is a persistent ID, this will give the
|
-- | If the @AuthId@ for a given site is a persistent ID, this will give the
|
||||||
-- value for that entity. E.g.:
|
-- value for that entity. E.g.:
|
||||||
@ -501,7 +501,7 @@ class (YesodAuth master, YesodPersist master) => YesodAuthPersist master where
|
|||||||
-- > type AuthId MySite = UserId
|
-- > type AuthId MySite = UserId
|
||||||
-- > AuthEntity MySite ~ User
|
-- > AuthEntity MySite ~ User
|
||||||
--
|
--
|
||||||
-- Since 1.2.0
|
-- @since 1.2.0
|
||||||
type AuthEntity master :: *
|
type AuthEntity master :: *
|
||||||
type AuthEntity master = KeyEntity (AuthId master)
|
type AuthEntity master = KeyEntity (AuthId master)
|
||||||
|
|
||||||
@ -534,14 +534,14 @@ type instance KeyEntity (Key x) = x
|
|||||||
-- | Similar to 'maybeAuthId', but redirects to a login page if user is not
|
-- | Similar to 'maybeAuthId', but redirects to a login page if user is not
|
||||||
-- authenticated or responds with error 401 if this is an API client (expecting JSON).
|
-- authenticated or responds with error 401 if this is an API client (expecting JSON).
|
||||||
--
|
--
|
||||||
-- Since 1.1.0
|
-- @since 1.1.0
|
||||||
requireAuthId :: YesodAuth master => HandlerT master IO (AuthId master)
|
requireAuthId :: YesodAuth master => HandlerT master IO (AuthId master)
|
||||||
requireAuthId = maybeAuthId >>= maybe handleAuthLack return
|
requireAuthId = maybeAuthId >>= maybe handleAuthLack return
|
||||||
|
|
||||||
-- | Similar to 'maybeAuth', but redirects to a login page if user is not
|
-- | Similar to 'maybeAuth', but redirects to a login page if user is not
|
||||||
-- authenticated or responds with error 401 if this is an API client (expecting JSON).
|
-- authenticated or responds with error 401 if this is an API client (expecting JSON).
|
||||||
--
|
--
|
||||||
-- Since 1.1.0
|
-- @since 1.1.0
|
||||||
requireAuth :: ( YesodAuthPersist master
|
requireAuth :: ( YesodAuthPersist master
|
||||||
, val ~ AuthEntity master
|
, val ~ AuthEntity master
|
||||||
, Key val ~ AuthId master
|
, Key val ~ AuthId master
|
||||||
@ -553,7 +553,7 @@ requireAuth = maybeAuth >>= maybe handleAuthLack return
|
|||||||
-- | Similar to 'requireAuth', but not tied to Persistent's 'Entity' type.
|
-- | Similar to 'requireAuth', but not tied to Persistent's 'Entity' type.
|
||||||
-- Instead, the 'AuthId' and 'AuthEntity' are returned in a tuple.
|
-- Instead, the 'AuthId' and 'AuthEntity' are returned in a tuple.
|
||||||
--
|
--
|
||||||
-- Since 1.4.0
|
-- @since 1.4.0
|
||||||
requireAuthPair :: (YesodAuthPersist master, Typeable (AuthEntity master))
|
requireAuthPair :: (YesodAuthPersist master, Typeable (AuthEntity master))
|
||||||
=> HandlerT master IO (AuthId master, AuthEntity master)
|
=> HandlerT master IO (AuthId master, AuthEntity master)
|
||||||
requireAuthPair = maybeAuthPair >>= maybe handleAuthLack return
|
requireAuthPair = maybeAuthPair >>= maybe handleAuthLack return
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user