diff --git a/modules/middleware/auth.go b/modules/middleware/auth.go index 82c3367c48a..64f75d75cf6 100644 --- a/modules/middleware/auth.go +++ b/modules/middleware/auth.go @@ -21,7 +21,7 @@ type ToggleOptions struct { func Toggle(options *ToggleOptions) martini.Handler { return func(ctx *Context) { - if options.SignOutRequire && ctx.IsSigned { + if options.SignOutRequire && ctx.IsSigned && ctx.Req.RequestURI != "/" { ctx.Redirect("/") return } diff --git a/web.go b/web.go index 9a613dceb6b..4236d8b31ac 100644 --- a/web.go +++ b/web.go @@ -88,7 +88,7 @@ func runWeb(*cli.Context) { reqSignOut := middleware.Toggle(&middleware.ToggleOptions{SignOutRequire: true}) // Routers. - m.Get("/", ignSignIn, routers.Home) + m.Get("/", reqSignIn, routers.Home) m.Get("/issues", reqSignIn, user.Issues) m.Get("/pulls", reqSignIn, user.Pulls) m.Get("/stars", reqSignIn, user.Stars)