From 2d9bf319d3f9c315f5a9336d12968d0446c65ad5 Mon Sep 17 00:00:00 2001 From: nek0 Date: Sat, 3 Dec 2016 19:06:24 +0100 Subject: [PATCH] error handling on wrong username --- src/Login.purs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Login.purs b/src/Login.purs index f035088..1669d81 100644 --- a/src/Login.purs +++ b/src/Login.purs @@ -80,8 +80,9 @@ resp1Success pass j = do log $ show j let eitherChallenge = decodeJson j case eitherChallenge of - Left e -> - fail Login e + Left _ -> + let eitherErr = decodeJson j + either (fail Login) (\(Err e) -> fail Login e.err) eitherErr Right (Challenge challenge) -> do progress "HMAC 1" let salted = runFn2 hmacSha3 (fromUtf8 pass) (fromHex challenge.salt)