[PR #297] Fix auth cookie secure flag for HTTP in production #329

Closed
opened 2025-11-20 04:14:07 -05:00 by saavagebueno · 0 comments
Owner

Original Pull Request: https://github.com/community-scripts/ProxmoxVE-Local/pull/297

State: closed
Merged: Yes


Problem

Authentication was failing in production mode when accessing the app over HTTP. Users would log in successfully but then be redirected back to the login page.

Root Cause

The cookie flag was set based on , which meant cookies required HTTPS even when the app was accessed over HTTP. Browsers would not set or send the cookie, causing authentication to fail.

Solution

  • Changed cookie flag to check the actual request protocol () instead of
  • Cookies now work correctly in both HTTP and HTTPS environments
  • Maintains security by still using when actually over HTTPS

Changes

  • Modified to detect request protocol
  • Added delay in to ensure cookie is available before verification (already committed)

Testing

  • Works in development mode (npm run dev)
  • Works in production mode over HTTP (npm start)
  • Maintains security for HTTPS connections
**Original Pull Request:** https://github.com/community-scripts/ProxmoxVE-Local/pull/297 **State:** closed **Merged:** Yes --- ## Problem Authentication was failing in production mode when accessing the app over HTTP. Users would log in successfully but then be redirected back to the login page. ## Root Cause The cookie flag was set based on , which meant cookies required HTTPS even when the app was accessed over HTTP. Browsers would not set or send the cookie, causing authentication to fail. ## Solution - Changed cookie flag to check the actual request protocol () instead of - Cookies now work correctly in both HTTP and HTTPS environments - Maintains security by still using when actually over HTTPS ## Changes - Modified to detect request protocol - Added delay in to ensure cookie is available before verification (already committed) ## Testing - ✅ Works in development mode (npm run dev) - ✅ Works in production mode over HTTP (npm start) - ✅ Maintains security for HTTPS connections
saavagebueno added the pull-request label 2025-11-20 04:14:07 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/ProxmoxVE-Local#329