happstack-authenticate-2.3.4: Happstack Authentication Library

Safe HaskellNone
LanguageHaskell98

Happstack.Authenticate.Password.Core

Synopsis

Documentation

mkHashedPass Source

Arguments

:: (Functor m, MonadIO m) 
=> Text

password in plain text

-> m HashedPass

salted and hashed

hash a password string

verifyHashedPass Source

Arguments

:: Text

password in plain text

-> HashedPass

hashed version of password

-> Bool 

verify a password

setPassword Source

Arguments

:: UserId

UserId

-> HashedPass

the hashed password

-> Update PasswordState () 

set the password for UserId

deletePassword Source

Arguments

:: UserId

UserId

-> Update PasswordState () 

delete the password for UserId

verifyPasswordForUserId Source

Arguments

:: UserId

UserId

-> Text

plain-text password

-> Query PasswordState Bool 

verify that the supplied password matches the stored hashed password for UserId

data SetPassword Source

Instances

UpdateEvent SetPassword Source 
Method SetPassword Source 
SafeCopy SetPassword Source 
type MethodState SetPassword = PasswordState Source 
type MethodResult SetPassword = () Source 

newtype DeletePassword Source

Constructors

DeletePassword UserId 

Instances

UpdateEvent DeletePassword Source 
Method DeletePassword Source 
SafeCopy DeletePassword Source 
type MethodState DeletePassword = PasswordState Source 
type MethodResult DeletePassword = () Source 

verifyPassword :: MonadIO m => AcidState AuthenticateState -> AcidState PasswordState -> Username -> Text -> m Bool Source

verify that the supplied username/password is valid

token :: Happstack m => AcidState AuthenticateState -> AuthenticateConfig -> AcidState PasswordState -> m Response Source

account :: Happstack m => AcidState AuthenticateState -> AcidState PasswordState -> AuthenticateConfig -> PasswordConfig -> Maybe (UserId, AccountURL) -> m (Either PasswordError UserId) Source

account handler

passwordRequestReset :: Happstack m => PasswordConfig -> AcidState AuthenticateState -> AcidState PasswordState -> m (Either PasswordError Text) Source

request reset password

issueResetToken :: MonadIO m => AcidState AuthenticateState -> User -> m (Either PasswordError JSON) Source

issueResetToken

passwordReset :: Happstack m => AcidState AuthenticateState -> AcidState PasswordState -> PasswordConfig -> m (Either PasswordError Text) Source

decodeAndVerifyResetToken :: MonadIO m => AcidState AuthenticateState -> Text -> m (Maybe (User, JWT VerifiedJWT)) Source