mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-04 05:18:25 +00:00 
			
		
		
		
	fix bug not to trim space of login username (#1796)
This commit is contained in:
		@@ -641,7 +641,12 @@ func UserSignIn(username, password string) (*User, error) {
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	} else {
 | 
			
		||||
		user = &User{LowerName: strings.ToLower(strings.TrimSpace(username))}
 | 
			
		||||
		trimmedUsername := strings.TrimSpace(username)
 | 
			
		||||
		if len(trimmedUsername) == 0 {
 | 
			
		||||
			return nil, ErrUserNotExist{0, username, 0}
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		user = &User{LowerName: strings.ToLower(trimmedUsername)}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	hasUser, err := x.Get(user)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user