Safe Haskell | None |
---|
- authEmail :: YesodAuthEmail m => AuthPlugin m
- class (YesodAuth site, PathPiece (AuthEmailId site)) => YesodAuthEmail site where
- type AuthEmailId site
- addUnverified :: Email -> VerKey -> HandlerT site IO (AuthEmailId site)
- sendVerifyEmail :: Email -> VerKey -> VerUrl -> HandlerT site IO ()
- getVerifyKey :: AuthEmailId site -> HandlerT site IO (Maybe VerKey)
- setVerifyKey :: AuthEmailId site -> VerKey -> HandlerT site IO ()
- verifyAccount :: AuthEmailId site -> HandlerT site IO (Maybe (AuthId site))
- getPassword :: AuthId site -> HandlerT site IO (Maybe SaltedPass)
- setPassword :: AuthId site -> SaltedPass -> HandlerT site IO ()
- getEmailCreds :: Identifier -> HandlerT site IO (Maybe (EmailCreds site))
- getEmail :: AuthEmailId site -> HandlerT site IO (Maybe Email)
- randomKey :: site -> IO Text
- afterPasswordRoute :: site -> Route site
- data EmailCreds site = EmailCreds {
- emailCredsId :: AuthEmailId site
- emailCredsAuthId :: Maybe (AuthId site)
- emailCredsStatus :: VerStatus
- emailCredsVerkey :: Maybe VerKey
- emailCredsEmail :: Email
- saltPass :: Text -> IO Text
- loginR :: AuthRoute
- registerR :: AuthRoute
- forgotPasswordR :: AuthRoute
- setpassR :: AuthRoute
- isValidPass :: Text -> SaltedPass -> Bool
- type Email = Text
- type VerKey = Text
- type VerUrl = Text
- type SaltedPass = Text
- type VerStatus = Bool
- type Identifier = Text
Plugin
authEmail :: YesodAuthEmail m => AuthPlugin mSource
class (YesodAuth site, PathPiece (AuthEmailId site)) => YesodAuthEmail site whereSource
type AuthEmailId site Source
addUnverified :: Email -> VerKey -> HandlerT site IO (AuthEmailId site)Source
Add a new email address to the database, but indicate that the address has not yet been verified.
Since 1.1.0
sendVerifyEmail :: Email -> VerKey -> VerUrl -> HandlerT site IO ()Source
Send an email to the given address to verify ownership.
Since 1.1.0
getVerifyKey :: AuthEmailId site -> HandlerT site IO (Maybe VerKey)Source
Get the verification key for the given email ID.
Since 1.1.0
setVerifyKey :: AuthEmailId site -> VerKey -> HandlerT site IO ()Source
Set the verification key for the given email ID.
Since 1.1.0
verifyAccount :: AuthEmailId site -> HandlerT site IO (Maybe (AuthId site))Source
Verify the email address on the given account.
Since 1.1.0
getPassword :: AuthId site -> HandlerT site IO (Maybe SaltedPass)Source
Get the salted password for the given account.
Since 1.1.0
setPassword :: AuthId site -> SaltedPass -> HandlerT site IO ()Source
Set the salted password for the given account.
Since 1.1.0
getEmailCreds :: Identifier -> HandlerT site IO (Maybe (EmailCreds site))Source
Get the credentials for the given Identifier
, which may be either an
email address or some other identification (e.g., username).
Since 1.2.0
getEmail :: AuthEmailId site -> HandlerT site IO (Maybe Email)Source
Get the email address for the given email ID.
Since 1.1.0
randomKey :: site -> IO TextSource
Generate a random alphanumeric string.
Since 1.1.0
afterPasswordRoute :: site -> Route siteSource
Route to send user to after password has been set correctly.
Since 1.2.0
data EmailCreds site Source
Data stored in a database for each e-mail address.
EmailCreds | |
|
Routes
:: Text | cleartext password |
-> SaltedPass | salted password |
-> Bool |
Types
type SaltedPass = TextSource
type Identifier = TextSource
An Identifier generalizes an email address to allow users to log in with some other form of credentials (e.g., username).
Note that any of these other identifiers must not be valid email addresses.
Since 1.2.0