diff --git a/routers/dashboard.go b/routers/dashboard.go index 76ecc3f67..2c81cf23c 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") } diff --git a/templates/repo/single_file.tmpl b/templates/repo/single_file.tmpl index 45586012b..6c7e5650a 100644 --- a/templates/repo/single_file.tmpl +++ b/templates/repo/single_file.tmpl @@ -6,14 +6,14 @@ {{else}} {{.FileName}} {{FileSize .FileSize}} -