chore: refactor cli and coderd to use ClientOptions (#19763)

Refactors CLI and coderd to use the ClientBuilder pattern rather than directly instantiating the Client.
This commit is contained in:
Spike Curtis
2025-09-22 21:02:56 +04:00
committed by GitHub
parent e7d648fb28
commit a30c30724b
5 changed files with 12 additions and 14 deletions
+1 -2
View File
@@ -137,8 +137,7 @@ type Details struct {
//
// The client is authenticated as the first user by default.
func (d *Details) AppClient(t *testing.T) *codersdk.Client {
client := codersdk.New(d.PathAppBaseURL)
client.SetSessionToken(d.SDKClient.SessionToken())
client := codersdk.New(d.PathAppBaseURL, codersdk.WithSessionToken(d.SDKClient.SessionToken()))
forceURLTransport(t, client)
client.HTTPClient.CheckRedirect = func(_ *http.Request, _ []*http.Request) error {
return http.ErrUseLastResponse