Deadbolt for Scala

The Deadbolt for Scala Developer Hub

Welcome to the Deadbolt for Scala developer hub. You'll find comprehensive guides and documentation to help you start working with Deadbolt for Scala as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    
Ask A Question

Questions

Request body is of type Nothing

Posted by Johan Dahlberg 8 months ago

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)
}

}
}

Loading comments...