modules/middleware/auth.go: remove uncheck login for watch a repo #929
This commit is contained in:
		
							parent
							
								
									6a23252edc
								
							
						
					
					
						commit
						28580aee63
					
				@ -6,7 +6,6 @@ package middleware
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	"net/url"
 | 
						"net/url"
 | 
				
			||||||
	"strings"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/Unknwon/macaron"
 | 
						"github.com/Unknwon/macaron"
 | 
				
			||||||
	"github.com/macaron-contrib/csrf"
 | 
						"github.com/macaron-contrib/csrf"
 | 
				
			||||||
@ -50,10 +49,6 @@ func Toggle(options *ToggleOptions) macaron.Handler {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
		if options.SignInRequire {
 | 
							if options.SignInRequire {
 | 
				
			||||||
			if !ctx.IsSigned {
 | 
								if !ctx.IsSigned {
 | 
				
			||||||
				// Ignore watch repository operation.
 | 
					 | 
				
			||||||
				if strings.HasSuffix(ctx.Req.RequestURI, "watch") {
 | 
					 | 
				
			||||||
					return
 | 
					 | 
				
			||||||
				}
 | 
					 | 
				
			||||||
				ctx.SetCookie("redirect_to", url.QueryEscape(setting.AppSubUrl+ctx.Req.RequestURI), 0, setting.AppSubUrl)
 | 
									ctx.SetCookie("redirect_to", url.QueryEscape(setting.AppSubUrl+ctx.Req.RequestURI), 0, setting.AppSubUrl)
 | 
				
			||||||
				ctx.Redirect(setting.AppSubUrl + "/user/login")
 | 
									ctx.Redirect(setting.AppSubUrl + "/user/login")
 | 
				
			||||||
				return
 | 
									return
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user