packages feed

yesod-auth-bcryptdb 0.1.0.1 → 0.2.0.0

raw patch · 2 files changed

+14/−3 lines, 2 files

Files

src/Yesod/Auth/BCryptDB.hs view
@@ -142,6 +142,7 @@ module Yesod.Auth.BCryptDB   ( BCryptDBUser(..)   , setPassword+  , setPasswordWithHashingPolicy   -- * Interface to database and Yesod.Auth   , authBCryptDB   , authBCryptDBWithForm@@ -198,10 +199,20 @@ setPassword   :: BCryptDBUser user   => Text          -- ^ Password-  -> HashingPolicy -- ^ @slowerBcryptHashingPolicy@ is recommended   -> user   -> IO user-setPassword password hashingPolicy user = do+setPassword = setPasswordWithHashingPolicy slowerBcryptHashingPolicy++-- | Set password for user. This function should be used for setting passwords+-- with an specified hashing policy. It generates random salt and calculates+-- proper hashes.+setPasswordWithHashingPolicy+  :: BCryptDBUser user+  => HashingPolicy+  -> Text          -- ^ Password+  -> user+  -> IO user+setPasswordWithHashingPolicy hashingPolicy password user = do     mHash <- saltAndHashPassword password hashingPolicy     return $ case mHash of                   Nothing   -> user
yesod-auth-bcryptdb.cabal view
@@ -1,5 +1,5 @@ name:                yesod-auth-bcryptdb-version:             0.1.0.1+version:             0.2.0.0 synopsis:            Authentication plugin for Yesod. description:   This package provides authentication with passwords hashed and salted using