mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-03 08:02:36 +09:00 
			
		
		
		
	Handle ErrUserProhibitLogin in http git (#7586)
This commit is contained in:
		@@ -215,7 +215,10 @@ func HTTP(ctx *context.Context) {
 | 
				
			|||||||
				// Check username and password
 | 
									// Check username and password
 | 
				
			||||||
				authUser, err = models.UserSignIn(authUsername, authPasswd)
 | 
									authUser, err = models.UserSignIn(authUsername, authPasswd)
 | 
				
			||||||
				if err != nil {
 | 
									if err != nil {
 | 
				
			||||||
					if !models.IsErrUserNotExist(err) {
 | 
										if models.IsErrUserProhibitLogin(err) {
 | 
				
			||||||
 | 
											ctx.HandleText(http.StatusUnauthorized, "User is not permitted to login")
 | 
				
			||||||
 | 
											return
 | 
				
			||||||
 | 
										} else if !models.IsErrUserNotExist(err) {
 | 
				
			||||||
						ctx.ServerError("UserSignIn error: %v", err)
 | 
											ctx.ServerError("UserSignIn error: %v", err)
 | 
				
			||||||
						return
 | 
											return
 | 
				
			||||||
					}
 | 
										}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user