55 "errors"
66 "fmt"
77 "io"
8- "os"
9- "strconv"
108 "strings"
119
1210 "github.com/containerd/errdefs"
@@ -183,24 +181,6 @@ func loginWithStoredCredentials(ctx context.Context, dockerCLI command.Cli, auth
183181 return response .Status , err
184182}
185183
186- // OauthLoginEscapeHatchEnvVar disables the browser-based OAuth login workflow.
187- //
188- // Deprecated: this const was only used internally and will be removed in the next release.
189- const OauthLoginEscapeHatchEnvVar = "DOCKER_CLI_DISABLE_OAUTH_LOGIN"
190-
191- const oauthLoginEscapeHatchEnvVar = "DOCKER_CLI_DISABLE_OAUTH_LOGIN"
192-
193- func isOauthLoginDisabled () bool {
194- if v := os .Getenv (oauthLoginEscapeHatchEnvVar ); v != "" {
195- enabled , err := strconv .ParseBool (v )
196- if err != nil {
197- return false
198- }
199- return enabled
200- }
201- return false
202- }
203-
204184func loginUser (ctx context.Context , dockerCLI command.Cli , opts loginOptions , defaultUsername , serverAddress string ) (msg string , _ error ) {
205185 // Some links documenting this:
206186 // - https://code.google.com/archive/p/mintty/issues/56
@@ -214,7 +194,7 @@ func loginUser(ctx context.Context, dockerCLI command.Cli, opts loginOptions, de
214194 }
215195
216196 // If we're logging into the index server and the user didn't provide a username or password, use the device flow
217- if serverAddress == registry .IndexServer && opts .user == "" && opts .password == "" && ! isOauthLoginDisabled () {
197+ if serverAddress == registry .IndexServer && opts .user == "" && opts .password == "" {
218198 var err error
219199 msg , err = loginWithDeviceCodeFlow (ctx , dockerCLI )
220200 // if the error represents a failure to initiate the device-code flow,
0 commit comments