Using deadbolt2 I have the following controller function implementation:
def restricted: Action = deadbolt.Restrict(List(Array(USER_ROLE)))() { request =>
Future {
val localUser = userProvider.getUser(request.session) // <<< expects a play.mvc.Http.Session
Ok(views.html.restricted(userProvider, localUser))
}
}
but it results in the following compiler error:
[error] /home/bravegag/code/play-authenticate-usage-scala/app/controllers/Application.scala:26: type mismatch;
[error] found : play.api.mvc.Session
[error] required: play.mvc.Http.Session
[error] val localUser = userProvider.getUser(request.session)
[error] ^
Basically the current request
is giving me a play.api.mvc.Session
but the library I depend on (play-authenticate) is expecting a play.mvc.Http.Session
. Is there a way to convert between the two? or another way to get hold of the needed Http one?