From ae317ab44a9075fff6baee8a8cdb4d6806fc9846 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 19 Oct 2026 16:43:18 +0200 Subject: [PATCH] internal/oauth: combine "web-based login" message with info note MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make the output less verbose, and combine the "web-based login" message with the info message that's already printed. Before this patch: docker login USING WEB-BASED LOGIN i Info → To sign in with credentials on the command line, use 'docker login -u ' Your one-time device confirmation code is: VVPV-NSSL Press ENTER to open your browser or submit your device code here: https://login.docker.com/activate Waiting for authentication in the browser… With this patch: docker login i Info → Using web-based login. To sign in with credentials on the command line, use 'docker login -u ' Your one-time device confirmation code is: QBBD-PQNS Press ENTER to open your browser or submit your device code here: https://login.docker.com/activate Waiting for authentication in the browser… Signed-off-by: Sebastiaan van Stijn --- docs/reference/commandline/login.md | 3 +-- e2e/registry/login_test.go | 2 +- internal/oauth/manager/manager.go | 4 +--- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/docs/reference/commandline/login.md b/docs/reference/commandline/login.md index a4e443bcaa..b5e03c487d 100644 --- a/docs/reference/commandline/login.md +++ b/docs/reference/commandline/login.md @@ -180,8 +180,7 @@ code, and authenticate. ```console $ docker login -USING WEB-BASED LOGIN -To sign in with credentials on the command line, use 'docker login -u ' +Using web-based login. To sign in with credentials on the command line, use 'docker login -u ' Your one-time device confirmation code is: LNFR-PGCJ Press ENTER to open your browser or submit your device code here: https://login.docker.com/activate diff --git a/e2e/registry/login_test.go b/e2e/registry/login_test.go index 0c53cf1268..3c9c18cf9d 100644 --- a/e2e/registry/login_test.go +++ b/e2e/registry/login_test.go @@ -30,5 +30,5 @@ func TestOauthLogin(t *testing.T) { assert.NilError(t, err) output, _ := io.ReadAll(p) - assert.Check(t, strings.Contains(string(output), "USING WEB-BASED LOGIN"), string(output)) + assert.Check(t, strings.Contains(string(output), "Using web-based login"), string(output)) } diff --git a/internal/oauth/manager/manager.go b/internal/oauth/manager/manager.go index 63af81128f..9997ed5982 100644 --- a/internal/oauth/manager/manager.go +++ b/internal/oauth/manager/manager.go @@ -97,8 +97,6 @@ func (m *OAuthManager) LoginDevice(ctx context.Context, w io.Writer) (*types.Aut return nil, ErrDeviceLoginStartFail } - _, _ = fmt.Fprintln(w, aec.Bold.Apply("\nUSING WEB-BASED LOGIN")) - var out tui.Output switch stream := w.(type) { case *streams.Out: @@ -106,7 +104,7 @@ func (m *OAuthManager) LoginDevice(ctx context.Context, w io.Writer) (*types.Aut default: out = tui.NewOutput(streams.NewOut(w)) } - out.PrintNote("To sign in with credentials on the command line, use 'docker login -u '\n") + out.PrintNote("Using web-based login. To sign in with credentials on the command line, use 'docker login -u '\n") _, _ = fmt.Fprintf(w, "\nYour one-time device confirmation code is: "+aec.Bold.Apply("%s\n"), state.UserCode) _, _ = fmt.Fprintf(w, aec.Bold.Apply("Press ENTER")+" to open your browser or submit your device code here: "+aec.Underline.Apply("%s\n"), strings.Split(state.VerificationURI, "?")[0])