diff --git a/internal/cli/cli.go b/internal/cli/cli.go index d497fbc3..7224007d 100644 --- a/internal/cli/cli.go +++ b/internal/cli/cli.go @@ -199,6 +199,8 @@ func (c curlRoundTripper) RoundTrip(r *http.Request) (*http.Response, error) { log.Debug(command.String()) + r.Header.Add("Client", "banzai-cli") + return c.base.RoundTrip(r) } diff --git a/internal/cli/command/login/oidc.go b/internal/cli/command/login/oidc.go index d6038f0e..55e525fc 100644 --- a/internal/cli/command/login/oidc.go +++ b/internal/cli/command/login/oidc.go @@ -311,13 +311,12 @@ func (a *app) requestTokenFromPipeline(rawIDToken string, refreshToken string) ( return "", fmt.Errorf("request returned: %s", string(body)) } - for _, cookie := range resp.Cookies() { - if cookie.Name == "user_sess" { - return cookie.Value, nil - } + sessionToken := resp.Header.Get("Authorization") + if sessionToken != "" { + return sessionToken, nil } - return "", fmt.Errorf("failed to find user_sess cookie in Pipeline response") + return "", fmt.Errorf("failed to find Authorization header in Pipeline response") } func (a *app) waitShutdown(server *http.Server) {