File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -289,16 +289,16 @@ func (c *Client) Login(host string, options ...LoginOption) error {
289289 return err
290290 }
291291 reg .PlainHTTP = c .plainHTTP
292+ cred := auth.Credential {Username : c .username , Password : c .password }
293+ c .authorizer .ForceAttemptOAuth2 = true
292294 reg .Client = c .authorizer
293295
294296 ctx := context .Background ()
295- cred , err := c .authorizer .Credential (ctx , host )
296- if err != nil {
297- return fmt .Errorf ("fetching credentials for %q: %w" , host , err )
298- }
299-
300297 if err := reg .Ping (ctx ); err != nil {
301- return fmt .Errorf ("authenticating to %q: %w" , host , err )
298+ c .authorizer .ForceAttemptOAuth2 = false
299+ if err := reg .Ping (ctx ); err != nil {
300+ return fmt .Errorf ("authenticating to %q: %w" , host , err )
301+ }
302302 }
303303
304304 // The credentialsStore loader does not handle empty files. So, there is a workaround.
You can’t perform that action at this time.
0 commit comments