Skip to content

Fix localhost development by adding ALLOW_LOCALHOST flag#356

Merged
Ernest-Gray merged 2 commits intodevelopfrom
fixing-localdev-auth-issues
Mar 17, 2026
Merged

Fix localhost development by adding ALLOW_LOCALHOST flag#356
Ernest-Gray merged 2 commits intodevelopfrom
fixing-localdev-auth-issues

Conversation

@Ernest-Gray
Copy link

Problem

  • local development was broke due to cookie settings
  • CORS issues persist but can be ignored if you run chrome with --disable-web-security
    • Only use --disable-web-security for localhost development, do not browse the web with this setting on
  • the stage name was not properly setup for redirect urls

Solution

  • Added ALLOW_LOCALHOST env var that can be set to true if developing
    • this correctly sets the cookie permissions so the auth cookie can get propegated to the backend
  • The redirect url is also corrected if localhost so the redirect after authentication is correct

Testing

  • Validated that the fix works with ALLOW_LOCALHOST=true
  • Validated that the problem persists with ALLOW_LOCALHOST=false (this is expected for production deployments)
  • testing done with running chrome with --disable-web-security to disable CORS related issues
    • "C:\Program Files\Google\Chrome\Application\chrome.exe" --user-data-dir=C:\chrome-dev-data\ --disable-web-security

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

- Add ALLOW_LOCALHOST environment variable to auth config
- Allow localhost:3000 redirect URLs when flag is enabled
- Set SameSite=None on session cookies for cross-site requests
- Add warning log when ALLOW_LOCALHOST is enabled in production
- Update frontend auth context to support localhost development
@Ernest-Gray Ernest-Gray requested a review from estohlmann March 17, 2026 14:31
@Ernest-Gray Ernest-Gray merged commit 7494bd0 into develop Mar 17, 2026
9 checks passed
@estohlmann estohlmann deleted the fixing-localdev-auth-issues branch March 17, 2026 15:41
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