Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions internal/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func Login(ctx context.Context) error {
if err != nil {
return fmt.Errorf("finding callback port: %w", err)
}
redirectURI := fmt.Sprintf("http://127.0.0.1:%d/callback", port)
redirectURI := fmt.Sprintf("http://127.0.0.1:%d/glean-cli-callback", port)

// Always do fresh DCR per login — the redirect URI (port) changes each time.
clientID, clientSecret, err := dcrOrStaticClient(ctx, host, registrationEndpoint, redirectURI)
Expand Down Expand Up @@ -94,7 +94,7 @@ func Login(ctx context.Context) error {
// LocalServerBindAddress and LocalServerCallbackPath must match the
// redirect_uri registered via DCR exactly. oauth2cli constructs the
// redirect URL from LocalServerBindAddress (127.0.0.1:{port}) + path.
LocalServerCallbackPath: "/callback",
LocalServerCallbackPath: "/glean-cli-callback",
LocalServerBindAddress: []string{fmt.Sprintf("127.0.0.1:%d", port)},
LocalServerReadyChan: readyChan,
AuthCodeOptions: []oauth2.AuthCodeOption{oauth2.S256ChallengeOption(verifier)},
Expand Down
4 changes: 2 additions & 2 deletions internal/auth/discovery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func TestRegisterClient_Success(t *testing.T) {
}))
defer srv.Close()

cl, err := registerClient(context.Background(), srv.URL, "http://127.0.0.1:9999/callback")
cl, err := registerClient(context.Background(), srv.URL, "http://127.0.0.1:9999/glean-cli-callback")
require.NoError(t, err)
assert.Equal(t, "dyn-client-id", cl.ClientID)
}
Expand All @@ -129,7 +129,7 @@ func TestRegisterClient_WithSecret(t *testing.T) {
}))
defer srv.Close()

cl, err := registerClient(context.Background(), srv.URL, "http://127.0.0.1:9999/callback")
cl, err := registerClient(context.Background(), srv.URL, "http://127.0.0.1:9999/glean-cli-callback")
require.NoError(t, err)
assert.Equal(t, "cs", cl.ClientSecret)
}
Loading