@@ -238,12 +238,30 @@ func loginWithDeviceCodeFlow(ctx context.Context, dockerCLI command.Cli) (msg st
238238 return "" , err
239239 }
240240
241- response , err := loginWithRegistry (ctx , dockerCLI .Client (), registrytypes .AuthConfig (* authConfig ))
241+ response , err := loginWithRegistry (ctx , dockerCLI .Client (), registrytypes.AuthConfig {
242+ Username : authConfig .Username ,
243+ Password : authConfig .Password ,
244+ ServerAddress : authConfig .ServerAddress ,
245+
246+ // TODO(thaJeztah): Are these expected to be included?
247+ Auth : authConfig .Auth ,
248+ IdentityToken : authConfig .IdentityToken ,
249+ RegistryToken : authConfig .RegistryToken ,
250+ })
242251 if err != nil {
243252 return "" , err
244253 }
245254
246- if err = storeCredentials (dockerCLI .ConfigFile (), registrytypes .AuthConfig (* authConfig )); err != nil {
255+ if err = storeCredentials (dockerCLI .ConfigFile (), registrytypes.AuthConfig {
256+ Username : authConfig .Username ,
257+ Password : authConfig .Password ,
258+ ServerAddress : authConfig .ServerAddress ,
259+
260+ // TODO(thaJeztah): Are these expected to be included?
261+ Auth : authConfig .Auth ,
262+ IdentityToken : authConfig .IdentityToken ,
263+ RegistryToken : authConfig .RegistryToken ,
264+ }); err != nil {
247265 return "" , err
248266 }
249267
@@ -252,7 +270,16 @@ func loginWithDeviceCodeFlow(ctx context.Context, dockerCLI command.Cli) (msg st
252270
253271func storeCredentials (cfg * configfile.ConfigFile , authConfig registrytypes.AuthConfig ) error {
254272 creds := cfg .GetCredentialsStore (authConfig .ServerAddress )
255- if err := creds .Store (configtypes .AuthConfig (authConfig )); err != nil {
273+ if err := creds .Store (configtypes.AuthConfig {
274+ Username : authConfig .Username ,
275+ Password : authConfig .Password ,
276+ ServerAddress : authConfig .ServerAddress ,
277+
278+ // TODO(thaJeztah): Are these expected to be included?
279+ Auth : authConfig .Auth ,
280+ IdentityToken : authConfig .IdentityToken ,
281+ RegistryToken : authConfig .RegistryToken ,
282+ }); err != nil {
256283 return fmt .Errorf ("error saving credentials: %v" , err )
257284 }
258285
0 commit comments