From 61e28146fb878ce6f451903c12f55eb72fb4138e Mon Sep 17 00:00:00 2001 From: takezoe Date: Sun, 16 Mar 2014 02:10:48 +0900 Subject: [PATCH] Fix TODO --- src/main/scala/app/ControllerBase.scala | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/scala/app/ControllerBase.scala b/src/main/scala/app/ControllerBase.scala index d47704a0d..d7d7171a2 100644 --- a/src/main/scala/app/ControllerBase.scala +++ b/src/main/scala/app/ControllerBase.scala @@ -36,18 +36,16 @@ abstract class ControllerBase extends ScalatraFilter if(path.startsWith("/console/")){ val account = httpRequest.getSession.getAttribute(Keys.Session.LoginAccount).asInstanceOf[Account] + val baseUrl = this.baseUrl(httpRequest) if(account == null){ // Redirect to login form - // TODO Should use the configured base url. - httpResponse.sendRedirect(context + "/signin?" + StringUtil.urlEncode(path)) + httpResponse.sendRedirect(baseUrl + "/signin?redirect=" + StringUtil.urlEncode(path)) } else if(account.isAdmin){ // H2 Console (administrators only) - // TODO Should use the configured base url. chain.doFilter(request, response) } else { // Redirect to dashboard - // TODO Should use the configured base url. - httpResponse.sendRedirect(context + "/") + httpResponse.sendRedirect(baseUrl + "/") } } else if(path.startsWith("/git/")){ // Git repository