mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	@@ -48,13 +48,8 @@ func BasicAuthDecode(encoded string) (user string, name string, err error) {
 | 
			
		||||
		return user, name, err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	a := strings.Split(string(s), ":")
 | 
			
		||||
	if len(a) == 2 {
 | 
			
		||||
		user, name = a[0], a[1]
 | 
			
		||||
	} else {
 | 
			
		||||
		err = errors.New("decode failed")
 | 
			
		||||
	}
 | 
			
		||||
	return user, name, err
 | 
			
		||||
	auth := strings.SplitN(string(s), ":", 2)
 | 
			
		||||
	return auth[0], auth[1], err
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func BasicAuthEncode(username, password string) string {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user