utf8-string -> text
This commit is contained in:
parent
881ea26d83
commit
b1e405beb8
@ -13,7 +13,8 @@ import System.Random
|
||||
import Control.Monad (when)
|
||||
import Control.Applicative ((<$>), (<*>))
|
||||
import Data.Digest.Pure.MD5
|
||||
import qualified Data.ByteString.Lazy.UTF8 as LU
|
||||
import qualified Data.Text.Lazy as T
|
||||
import Data.Text.Lazy.Encoding (encodeUtf8)
|
||||
|
||||
login, register, setpass :: AuthRoute
|
||||
login = PluginR "email" ["login"]
|
||||
@ -239,7 +240,10 @@ saltPass pass = do
|
||||
return $ saltPass' salt pass
|
||||
|
||||
saltPass' :: String -> String -> String
|
||||
saltPass' salt pass = salt ++ show (md5 $ LU.fromString $ salt ++ pass)
|
||||
saltPass' salt pass =
|
||||
salt ++ show (md5 $ fromString $ salt ++ pass)
|
||||
where
|
||||
fromString = encodeUtf8 . T.pack
|
||||
|
||||
isValidPass :: String -- ^ cleartext password
|
||||
-> SaltedPass -- ^ salted password
|
||||
|
||||
@ -22,7 +22,7 @@ library
|
||||
, random >= 1.0 && < 1.1
|
||||
, data-object >= 0.3.1.3 && < 0.4
|
||||
, control-monad-attempt >= 0.3.0 && < 0.4
|
||||
, utf8-string >= 0.3.4 && < 0.4
|
||||
, text >= 0.7 && < 0.11
|
||||
, blaze-builder >= 0.1 && < 0.2
|
||||
, mime-mail >= 0.0 && < 0.1
|
||||
exposed-modules: Yesod.Helpers.Auth
|
||||
|
||||
Loading…
Reference in New Issue
Block a user