From 8ca14e210959b9316a4eed6e127de1eb775fda74 Mon Sep 17 00:00:00 2001 From: Unknown Date: Tue, 6 May 2014 16:28:52 -0400 Subject: Improve delete SSH key --- modules/middleware/auth.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'modules/middleware') diff --git a/modules/middleware/auth.go b/modules/middleware/auth.go index cd00d4679e..e208fb017e 100644 --- a/modules/middleware/auth.go +++ b/modules/middleware/auth.go @@ -6,6 +6,7 @@ package middleware import ( "net/url" + "strings" "github.com/go-martini/martini" @@ -40,6 +41,10 @@ func Toggle(options *ToggleOptions) martini.Handler { if options.SignInRequire { if !ctx.IsSigned { + // Ignore watch repository operation. + if strings.HasSuffix(ctx.Req.RequestURI, "watch") { + return + } ctx.SetCookie("redirect_to", "/"+url.QueryEscape(ctx.Req.RequestURI)) ctx.Redirect("/user/login") return -- cgit v1.2.3