Search code examples
scalaplayframeworkplayframework-2.1securesocial

Getting an error when trying to secure controller method with securesocial


When trying to implement a SecuredAction like this:

def index = SecuredAction {
    Ok(views.html.index())
}

I'm getting a

Overloaded method value [SecuredAction] cannot be applied to (play.api.mvc.SimpleResult[play.api.templates.Html])

Solution

  • Forgot about implicit request =>

    So:

    def index = SecuredAction { implicit request =>
        Ok(views.html.index())
    }
    

    Is correct.