From 743fee60158edb5815b86504db29b268f29e1cbf Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 24 Mar 2014 12:43:51 -0400 Subject: Fix --- routers/dashboard.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'routers') diff --git a/routers/dashboard.go b/routers/dashboard.go index 76ecc3f676..2c81cf23c1 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") } -- cgit v1.2.3