Discussions

Ask a Question
Back to All

Request body is of type Nothing

Hi!

Usually I can use request.body.asJson to get the data passed to my action. But when I'm using Deadbolt I get a "be.objectify.deadbolt.scala.AuthenticatedRequest" where body is "Nothing" and "AnyContent" when not using Deadbolt.

I guess that I'm supposed to be able to reach the body even if I'm using Deadbolt, right?

Snippet of the code:

class Application @Inject()(deadbolt: DeadboltActions) extends Controller {
def search = deadbolt.SubjectPresent()() { authRequest =>
Future {
var currentUser: User = authRequest.subject.get.asInstanceOf[User]
// authRequest.body.asJson

  Ok("Hello " + currentUser.name)
}

}
}