aboutsummaryrefslogtreecommitdiff
path: root/routers/dashboard.go
diff options
context:
space:
mode:
authorskyblue <ssx205@gmail.com>2014-03-25 18:35:15 +0800
committerskyblue <ssx205@gmail.com>2014-03-25 18:35:15 +0800
commitf0352789cd1e5c3ee35ed685e29421f0bc02f336 (patch)
treee3c0454dcba62f689221d5a97efcef342c06ffd2 /routers/dashboard.go
parent7048ea45279cd96f88845d83fe7cef6fbb545fcf (diff)
parent4e88ae19d1e2e91e4d3168304c06fcbce73c31bf (diff)
Merge branch 'master' of github.com:gogits/gogs
Diffstat (limited to 'routers/dashboard.go')
-rw-r--r--routers/dashboard.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/routers/dashboard.go b/routers/dashboard.go
index 76ecc3f6..2c81cf23 100644
--- a/routers/dashboard.go
+++ b/routers/dashboard.go
@@ -5,6 +5,7 @@
package routers
import (
+ "github.com/gogits/gogs/modules/base"
"github.com/gogits/gogs/modules/middleware"
"github.com/gogits/gogs/routers/user"
)
@@ -14,6 +15,14 @@ func Home(ctx *middleware.Context) {
user.Dashboard(ctx)
return
}
+
+ // Check auto-login.
+ userName := ctx.GetCookie(base.CookieUserName)
+ if len(userName) != 0 {
+ ctx.Redirect("/user/login")
+ return
+ }
+
ctx.Data["PageIsHome"] = true
ctx.HTML(200, "home")
}