Skip to content

fix: local okta sso flow#59

Merged
maxy-shpfy merged 1 commit into
mainfrom
07-01-fix_local_okta_sso_flow
Jul 2, 2026
Merged

fix: local okta sso flow#59
maxy-shpfy merged 1 commit into
mainfrom
07-01-fix_local_okta_sso_flow

Conversation

@maxy-shpfy

@maxy-shpfy maxy-shpfy commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

TL;DR

Adds automatic .env file loading on server startup and makes the Oktasso token cookie name configurable via an environment variable.

What changed?

  • Introduced a loadEnv.ts module that attempts to load a .env file from the project root using process.loadEnvFile. If no .env file is present, it silently continues, allowing environment variables to be sourced from the real environment instead.
  • This module is imported at the top of index.ts so it runs before anything else.
  • The Oktasso auth script now reads the token cookie name from AUTH_JWT_TOKEN_COOKIE_NAME instead of using the hardcoded string OKTASSO_TOKEN.

How to test?

  • Create a .env file at the project root with relevant environment variables and start the server — confirm the variables are picked up correctly.
  • Start the server without a .env file — confirm it starts without errors.
  • Run the Oktasso auth flow and verify the resulting cookie uses the name defined in AUTH_JWT_TOKEN_COOKIE_NAME.

Why make this change?

Hardcoding the .env loading approach and the cookie name reduced flexibility across environments. Loading the .env file automatically removes the need for manual setup steps, and making the cookie name configurable allows it to stay in sync with the JWT token cookie name used elsewhere in the application.

Copy link
Copy Markdown
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@maxy-shpfy maxy-shpfy marked this pull request as ready for review July 2, 2026 05:08
@maxy-shpfy maxy-shpfy merged commit 58187f4 into main Jul 2, 2026
11 checks passed
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.

1 participant