chore(testdata): generate a user with simple password authentication
This commit is contained in:
parent
282a7d44b2
commit
8f2bb43e2a
@ -1,6 +1,6 @@
|
||||
{-# OPTIONS_GHC -fno-warn-orphans #-}
|
||||
|
||||
module Application
|
||||
|
||||
module Application
|
||||
( getAppSettings, getAppDevSettings
|
||||
, appMain
|
||||
, develMain
|
||||
|
||||
@ -7,6 +7,8 @@ import "uniworx" Import hiding (Option(..), currentYear)
|
||||
|
||||
import qualified Data.ByteString.Lazy as LBS
|
||||
-- import qualified Data.Text as Text
|
||||
import qualified Data.Text.Encoding as TEnc
|
||||
import qualified Yesod.Auth.Util.PasswordStore as PWStore
|
||||
-- import Data.Text.IO (hPutStrLn)
|
||||
|
||||
import qualified Data.Set as Set
|
||||
@ -133,9 +135,15 @@ fillDb = do
|
||||
, userSex = Just SexMale
|
||||
, userShowSex = userDefaultShowSex
|
||||
}
|
||||
pwSimple <- do
|
||||
let pw = "123.456"
|
||||
PWHashConf{..} <- getsYesod $ view _appAuthPWHash
|
||||
pwHash <- liftIO $ PWStore.makePasswordWith pwHashAlgorithm pw pwHashStrength
|
||||
return $ AuthPWHash $ TEnc.decodeUtf8 pwHash
|
||||
jost <- insert User
|
||||
{ userIdent = "jost@tcs.ifi.lmu.de"
|
||||
, userAuthentication = AuthLDAP
|
||||
-- , userAuthentication = AuthLDAP
|
||||
, userAuthentication = pwSimple
|
||||
, userLastAuthentication = Nothing
|
||||
, userTokensIssuedAfter = Nothing
|
||||
, userMatrikelnummer = Nothing
|
||||
|
||||
Loading…
Reference in New Issue
Block a user