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 config.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func registerFlags(cmd *cobra.Command) {
cmd.PersistentFlags().
IntVar(&flagCallbackPort, "port", 0, "Local callback port for browser flow (default: 8888 or CALLBACK_PORT env)")
cmd.PersistentFlags().
StringVar(&flagScope, "scope", "", "Space-separated OAuth scopes (default: \"read write\")")
StringVar(&flagScope, "scope", "", "Space-separated OAuth scopes (default: \"email profile\")")
Comment on lines 120 to +122
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The README still documents the default SCOPE env var value as read write (README.md:260). Since this flag help text now states the default is email profile, please update the README (and any other user-facing docs) to keep the documented defaults consistent.

Copilot uses AI. Check for mistakes.
cmd.PersistentFlags().
StringVar(&flagTokenFile, "token-file", "", "Token storage file (default: .authgate-tokens.json or TOKEN_FILE env)")
cmd.PersistentFlags().
Expand Down Expand Up @@ -182,7 +182,7 @@ func loadConfig() *AppConfig {
cfg.ForceDevice = flagDevice
cfg.ServerURL = getConfig(flagServerURL, "SERVER_URL", "http://localhost:8080")
cfg.ClientSecret = getConfig(flagClientSecret, "CLIENT_SECRET", "")
cfg.Scope = getConfig(flagScope, "SCOPE", "read write")
cfg.Scope = getConfig(flagScope, "SCOPE", "email profile")

// Resolve callback port (int flag needs special handling).
portStr := ""
Expand Down
4 changes: 2 additions & 2 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func testConfig(t *testing.T) *AppConfig {
return &AppConfig{
ServerURL: serverURL,
ClientID: "test-client",
Scope: "read write",
Scope: "email profile",
RetryClient: rc,
Store: credstore.NewTokenFileStore(
filepath.Join(t.TempDir(), "tokens.json"),
Expand Down Expand Up @@ -235,7 +235,7 @@ func TestBuildAuthURL_ContainsRequiredParams(t *testing.T) {
ServerURL: "http://localhost:8080",
ClientID: "my-client-id",
RedirectURI: "http://localhost:8888/callback",
Scope: "read write",
Scope: "email profile",
Endpoints: defaultEndpoints("http://localhost:8080"),
}

Expand Down
Loading