Display password prompt in CLI add-user

This commit is contained in:
Saku Laesvuori 2023-09-28 23:01:23 +03:00
parent 09a318ae32
commit 12e2d2a3e0
Signed by: slaesvuo
GPG Key ID: 257D284A2A1D3A32
1 changed files with 1 additions and 1 deletions

View File

@ -32,7 +32,7 @@ main = do
addUserMain :: AddUserOpts -> CLIM ()
addUserMain AddUserOpts {..} = do
time <- currentTime
passwordHash <- putStr "Password: " >> liftIO (withoutInputEcho getLine) >>= hashPassword
passwordHash <- putStr "Password: " >> hFlush stdout >> liftIO (withoutInputEcho getLine) >>= hashPassword
userID <- addUser $ DBUser
{ dBUserRegistered = time
, dBUserPasswordCrypt = passwordHash