MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / cliAuthBrowserURL

Function cliAuthBrowserURL

cmd/pad/cmd_auth.go:411–413  ·  view source on GitHub ↗

cliAuthBrowserURL builds the auth-approval URL we print to the user during `pad auth login`. We construct it on the CLI side rather than trusting the server-issued auth_url field: the server builds its URL from r.Host, which echoes back whatever Host header the CLI sent. If the CLI's own config poin

(cfg *config.Config, sessionCode string)

Source from the content-addressed store, hash-verified

409// and returns the explicit URL verbatim for Remote/Cloud, so it's the
410// right source of truth.
411func cliAuthBrowserURL(cfg *config.Config, sessionCode string) string {
412 return fmt.Sprintf("%s/auth/cli/%s", cfg.BrowserURL(), sessionCode)
413}
414
415// doBrowserLogin implements the browser-based CLI auth flow.
416// It creates a pending session, prints the auth URL, and polls until approved.

Callers 2

doBrowserLoginFunction · 0.85

Calls 1

BrowserURLMethod · 0.80

Tested by 1