summaryrefslogtreecommitdiffstats
path: root/routers/dashboard.go
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-03-24 12:43:51 -0400
committerUnknown <joe2010xtmf@163.com>2014-03-24 12:43:51 -0400
commit743fee60158edb5815b86504db29b268f29e1cbf (patch)
tree3d10b00b7dfb41f6c339c24fa9909bdcd209abfe /routers/dashboard.go
parent79633ab1fbb823ca2f6267e99bb8912ce227d293 (diff)
downloadgitea-743fee60158edb5815b86504db29b268f29e1cbf.tar.gz
gitea-743fee60158edb5815b86504db29b268f29e1cbf.zip
Fix
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 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")
}