userLogin :: EitherIO LoginError Text | |
userLogin = do | |
token <- getToken | |
userpw <- maybe (liftEither (Left NoSuchUser)) | |
return (Map.lookup token users) | |
password <- liftIO ( | |
T.putStrLn "Enter your password:" >> | |
T.getLine | |
) | |
if userpw == password then | |
return token | |
else | |
liftEither (Left WrongPassword) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment