case class UserValidRequest(email: String, password: String)
case class UserValidResponse(valid: Boolean, user: Option[User])
val client = Env.registry.akkaClient(name = "USERCHECK", retry = 5)
def isValidUser(email: String, password: String): Future[Option[(Boolean, User)]] = {
client.ask[UserValidResponse](UserValidRequest(email, password)).map {
case UserValidResponse(_, None) => None
case UserValidResponse(valid, Some(user)) => Some((valid, user))
}
}
}