It seems like you are using play framework 2.2. There were some changes and most methods return Future[SimpleResult]
instead of just Result
or SimpleResult
. You can check if you are able to do like this: def index = SecuredAction.async {...}
(but I'm almost sure you can't).
You can use this approach to make it work correctly:
import scala.concurrent.Await
import scala.concurrent.duration._
def index = SecuredAction { implicit request =>
Await.result(Assets.at("/public", "index.html").apply(request), 5 seconds) //you can specify you maximum wait time here
}
EDIT
Even one more thing to simplify:
Await.result(unprotectedIndex(request), 5 seconds)
So you can call your unprotectedIndex
from your index
Action