@@ -74,7 +74,6 @@ Examples:
7474 endpoint : endpoint ,
7575 out : os .Stdout ,
7676 useOAuth : * useOAuth ,
77- oauthClientID : * OAuthClientID ,
7877 apiFlags : apiFlags ,
7978 deviceFlowClient : oauth .NewClient (oauth .DefaultClientID ),
8079 })
@@ -93,7 +92,6 @@ type loginParams struct {
9392 endpoint string
9493 out io.Writer
9594 useOAuth bool
96- oauthClientID string
9795 apiFlags * api.Flags
9896 deviceFlowClient oauth.Client
9997}
@@ -127,7 +125,7 @@ func loginCmd(ctx context.Context, p loginParams) error {
127125 cfg .Endpoint = endpointArg
128126
129127 if p .useOAuth {
130- token , err := runOAuthDeviceFlow (ctx , endpointArg , p . oauthClientID , out , p .deviceFlowClient )
128+ token , err := runOAuthDeviceFlow (ctx , endpointArg , out , p .deviceFlowClient )
131129 if err != nil {
132130 printProblem (fmt .Sprintf ("OAuth Device flow authentication failed: %s" , err ))
133131 fmt .Fprintln (out , createAccessTokenMessage )
@@ -194,7 +192,7 @@ func loginCmd(ctx context.Context, p loginParams) error {
194192 return nil
195193}
196194
197- func runOAuthDeviceFlow (ctx context.Context , endpoint , clientID string , out io.Writer , client oauth.Client ) (* oauth.Token , error ) {
195+ func runOAuthDeviceFlow (ctx context.Context , endpoint string , out io.Writer , client oauth.Client ) (* oauth.Token , error ) {
198196 authResp , err := client .Start (ctx , endpoint , nil )
199197 if err != nil {
200198 return nil , err
@@ -225,7 +223,7 @@ func runOAuthDeviceFlow(ctx context.Context, endpoint, clientID string, out io.W
225223 }
226224
227225 token := resp .Token (endpoint )
228- token .ClientID = clientID
226+ token .ClientID = client . ClientID ()
229227 return token , nil
230228}
231229
0 commit comments