mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Remove legacy handling of drone token (#8191)
Now Drone has removed Gitea user/pass handling we can remove legacy handling
This commit is contained in:
		
				
					committed by
					
						
						Lauris BH
					
				
			
			
				
	
			
			
			
						parent
						
							eec997d30a
						
					
				
				
					commit
					a60d3cbea2
				
			@@ -35,9 +35,6 @@ func ListAccessTokens(ctx *context.APIContext) {
 | 
			
		||||
 | 
			
		||||
	apiTokens := make([]*api.AccessToken, len(tokens))
 | 
			
		||||
	for i := range tokens {
 | 
			
		||||
		if tokens[i].Name == "drone" {
 | 
			
		||||
			tokens[i].Name = "drone-legacy-use-oauth2-instead"
 | 
			
		||||
		}
 | 
			
		||||
		apiTokens[i] = &api.AccessToken{
 | 
			
		||||
			ID:             tokens[i].ID,
 | 
			
		||||
			Name:           tokens[i].Name,
 | 
			
		||||
@@ -78,9 +75,6 @@ func CreateAccessToken(ctx *context.APIContext, form api.CreateAccessTokenOption
 | 
			
		||||
		UID:  ctx.User.ID,
 | 
			
		||||
		Name: form.Name,
 | 
			
		||||
	}
 | 
			
		||||
	if t.Name == "drone" {
 | 
			
		||||
		t.Name = "drone-legacy-use-oauth2-instead"
 | 
			
		||||
	}
 | 
			
		||||
	if err := models.NewAccessToken(t); err != nil {
 | 
			
		||||
		ctx.Error(500, "NewAccessToken", err)
 | 
			
		||||
		return
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user