File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,9 @@ func ListAccessTokens(ctx *context.APIContext) {
36
36
37
37
apiTokens := make ([]* api.AccessToken , len (tokens ))
38
38
for i := range tokens {
39
+ if tokens [i ].Name == "drone" {
40
+ tokens [i ].Name = "drone-legacy-use-oauth2-instead"
41
+ }
39
42
apiTokens [i ] = & api.AccessToken {
40
43
ID : tokens [i ].ID ,
41
44
Name : tokens [i ].Name ,
@@ -76,14 +79,18 @@ func CreateAccessToken(ctx *context.APIContext, form api.CreateAccessTokenOption
76
79
UID : ctx .User .ID ,
77
80
Name : form .Name ,
78
81
}
82
+ if t .Name == "drone" {
83
+ t .Name = "drone-legacy-use-oauth2-instead"
84
+ }
79
85
if err := models .NewAccessToken (t ); err != nil {
80
86
ctx .Error (500 , "NewAccessToken" , err )
81
87
return
82
88
}
83
89
ctx .JSON (201 , & api.AccessToken {
84
- Name : t .Name ,
85
- Token : t .Token ,
86
- ID : t .ID ,
90
+ Name : t .Name ,
91
+ Token : t .Token ,
92
+ ID : t .ID ,
93
+ TokenLastEight : t .TokenLastEight ,
87
94
})
88
95
}
89
96
You can’t perform that action at this time.
0 commit comments