Last active
January 4, 2019 20:07
-
-
Save mattroberts297/f10d5c004cec2bc71804a24052638be9 to your computer and use it in GitHub Desktop.
SignupInfra.scala
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 signup | |
(request: HttpRequest): Future[HttpResponse] = | |
for { | |
r <- parse(request) | |
_ = info(“Parsed body”) | |
s <- salt(512) | |
_ = info(“Created salt”) | |
h <- hash(r.p, s, 10000) | |
_ = info(“Created hash”) | |
u = User(r.e, h, s) | |
_ <- persist(u) | |
// JVM crashes because it ran out of memory | |
_ = info(“Persisted user”) | |
} yield { HttpResponse(StatusCodes.OK) } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment