error handling on wrong username

This commit is contained in:
nek0 2016-12-03 19:06:24 +01:00
parent fc3dabe336
commit 2d9bf319d3

View file

@ -80,8 +80,9 @@ resp1Success pass j = do
log $ show j log $ show j
let eitherChallenge = decodeJson j let eitherChallenge = decodeJson j
case eitherChallenge of case eitherChallenge of
Left e -> Left _ ->
fail Login e let eitherErr = decodeJson j
either (fail Login) (\(Err e) -> fail Login e.err) eitherErr
Right (Challenge challenge) -> do Right (Challenge challenge) -> do
progress "HMAC 1" progress "HMAC 1"
let salted = runFn2 hmacSha3 (fromUtf8 pass) (fromHex challenge.salt) let salted = runFn2 hmacSha3 (fromUtf8 pass) (fromHex challenge.salt)