mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Fix dashboard auto-log bug
This commit is contained in:
		@@ -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
 | 
			
		||||
		}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								web.go
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								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)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user