Skip to content

Use strconv.ParseBool for COOKIE_SECURE config parsing - #45

Merged
pikann merged 2 commits into
feature/implement-auth-apisfrom
copilot/sub-pr-44
Mar 25, 2026
Merged

pikann merged 2 commits into
feature/implement-auth-apisfrom
copilot/sub-pr-44

Conversation

Copilot AI commented Mar 25, 2026 •

Copy link
Copy Markdown
Contributor

COOKIE_SECURE was parsed via strict == "true" string comparison, silently treating "TRUE", "1", or "True" as false.

Changes

  • config/load.go: Replace env("COOKIE_SECURE", "false") == "true" with strconv.ParseBool, consistent with how other optional config values (JWT_ACCESS_TTL, JWT_REFRESH_TTL) are handled
    • Accepts all standard boolean representations: "1", "t", "T", "TRUE", "true", "True", "0", "f", "F", "FALSE", "false", "False"
    • Returns an explicit error on invalid values (e.g. config: COOKIE_SECURE: strconv.ParseBool: parsing "yes": invalid syntax)
// Before
CookieSecure: env("COOKIE_SECURE", "false") == "true",

// After
cookieSecure, err := strconv.ParseBool(env("COOKIE_SECURE", "false"))
if err != nil {
    return nil, fmt.Errorf("config: COOKIE_SECURE: %w", err)
}
// ...
CookieSecure: cookieSecure,

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] [WIP] Address feedback on auth APIs implementation Use strconv.ParseBool for COOKIE_SECURE config parsing Mar 25, 2026
Copilot AI requested a review from pikann March 25, 2026 04:45
@pikann
pikann marked this pull request as ready for review March 25, 2026 04:50
@pikann
pikann merged commit cdb376d into feature/implement-auth-apis Mar 25, 2026
4 checks passed
@pikann
pikann deleted the copilot/sub-pr-44 branch March 25, 2026 04:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants