Guest User

Untitled

a guest
Jan 18th, 2018
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. class HomeController @Inject()(env: Environment, conf: Configuration, assets: Assets, authenticatedAction: AuthenticatedAction, cc: ControllerComponents, implicit val config: ServiceConfig)(implicit ec: ExecutionContext)
  2. extends AbstractController(cc) {
  3.  
  4. private val logger = play.api.Logger(this.getClass)
  5.  
  6. private def doServeArbitraryRoutes(route: String): Action[AnyContent] = Action.async {
  7. request: Request[AnyContent] => {
  8. Future {
  9. authenticatedAction.isSessionValid(request)
  10. .map(authenticatedRequest => Ok(views.html.index("Human Intelligent Tasks")))
  11. .getOrElse(Redirect(routes.HomeController.login())
  12. )
  13. }
  14. }
  15. }
  16. def index: Action[AnyContent] = doServeArbitraryRoutes("")
  17.  
  18.  
  19. }
Add Comment
Please, Sign In to add comment