diff options
author | Unknown <joe2010xtmf@163.com> | 2014-05-06 16:28:52 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-05-06 16:28:52 -0400 |
commit | 8ca14e210959b9316a4eed6e127de1eb775fda74 (patch) | |
tree | 93af1213d80c700838b1c41eb1c1c9ffcbfd60d6 /modules/middleware | |
parent | 7cb5a15c9b7a2a118d756d15cb745743f207a318 (diff) | |
download | gitea-8ca14e210959b9316a4eed6e127de1eb775fda74.tar.gz gitea-8ca14e210959b9316a4eed6e127de1eb775fda74.zip |
Improve delete SSH key
Diffstat (limited to 'modules/middleware')
-rw-r--r-- | modules/middleware/auth.go | 5 |
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 |