Skip to content

Make secure cookie settings conditional on non-development mode #2937

Closed

Description

@migmartri

PR #2933 introduced secure cookie settings (HttpOnly, Secure, SameSite) in setOauthCookie to fix a CodeQL SAST warning. While these settings are correct for production, they break local development when the control plane is not running behind HTTPS (e.g., accessed via a non-localhost address).

The Secure flag requires HTTPS, which is not available in the default development setup.

Proposed fix: make Secure, HttpOnly, and SameSite conditional on whether the system is running in development mode. Development mode is determined by server.Version == "dev" (the default value, overridden at build time for releases). When in dev mode, these flags should be omitted or relaxed so local OAuth flows continue to work.

Affected code: app/controlplane/internal/service/auth.go — setOauthCookie function.

Activity

  1. self-assigned this
    on Mar 26, 2026
  2. added 2 commits that reference this issue on Mar 26, 2026
    83eae5e
    309cf21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions