diff options
author | Unknown <joe2010xtmf@163.com> | 2014-03-24 12:43:51 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-03-24 12:43:51 -0400 |
commit | 743fee60158edb5815b86504db29b268f29e1cbf (patch) | |
tree | 3d10b00b7dfb41f6c339c24fa9909bdcd209abfe /routers/dashboard.go | |
parent | 79633ab1fbb823ca2f6267e99bb8912ce227d293 (diff) | |
download | gitea-743fee60158edb5815b86504db29b268f29e1cbf.tar.gz gitea-743fee60158edb5815b86504db29b268f29e1cbf.zip |
Fix
Diffstat (limited to 'routers/dashboard.go')
-rw-r--r-- | routers/dashboard.go | 9 |
1 files changed, 9 insertions, 0 deletions
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") } |