Last active
January 2, 2017 19:28
-
-
Save srp/6d2d6b2b810d09596e497092ec2a9a8a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def login(dbConn: DbConnection, req Reuqest): Try[Response] = | |
req.body match { | |
case Failure(err) => | |
Failure(err) | |
case Success(reqJsonStr) => | |
json.parse(reqJsonStr) match { | |
case Failure(err) => | |
Failure(err) | |
case Success(reqJson) => | |
validateAndDecode[LoginRequest](reqJson) match { | |
case Failure(err) => | |
Failure(err) | |
case Success(loginReq) => | |
dbConn.findUser(loginReq.username) match { | |
... | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment