summaryrefslogtreecommitdiffstats
path: root/modules/middleware
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-05-06 16:28:52 -0400
committerUnknown <joe2010xtmf@163.com>2014-05-06 16:28:52 -0400
commit8ca14e210959b9316a4eed6e127de1eb775fda74 (patch)
tree93af1213d80c700838b1c41eb1c1c9ffcbfd60d6 /modules/middleware
parent7cb5a15c9b7a2a118d756d15cb745743f207a318 (diff)
downloadgitea-8ca14e210959b9316a4eed6e127de1eb775fda74.tar.gz
gitea-8ca14e210959b9316a4eed6e127de1eb775fda74.zip
Improve delete SSH key
Diffstat (limited to 'modules/middleware')
-rw-r--r--modules/middleware/auth.go5
1 files changed, 5 insertions, 0 deletions
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