문제

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])
도움이 되었습니까?

해결책

Forgot about implicit request =>

So:

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

Is correct.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top