Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@manzke
Copy link
Contributor

@manzke manzke commented Nov 13, 2025

…c assets

When users directly navigate to deep links (e.g., /apps/meeting-analyser) with OIDC, assets were failing to load due to incorrect path resolution.

Root cause: Base tag was not being created for root-level routes, causing relative asset paths to resolve incorrectly.

Changes:

  1. server/middleware/setup.js

    • Add static asset and SPA route bypass for authentication
    • Prevents auth middleware from blocking HTML pages and assets
    • Environment-aware: dev-specific paths only in development
  2. server/routes/staticRoutes.js

    • Add file extension check to catch-all route
    • Return 404 for missing static assets instead of serving index.html
    • Prevents misrouted asset requests from getting HTML responses
  3. client/index.html

    • Fix base tag detection for root-level routes
    • When route detected at index 0, set basePath to '/' instead of ''
    • Always create base tag to ensure proper asset resolution
    • Still supports subdirectory deployments dynamically

Result: Direct navigation to any route now works correctly with proper asset loading, while maintaining subdirectory deployment support.

🤖 Generated with Claude Code

…c assets

When users directly navigate to deep links (e.g., /apps/meeting-analyser)
with OIDC, assets were failing to load due to incorrect path resolution.

Root cause: Base tag was not being created for root-level routes, causing
relative asset paths to resolve incorrectly.

Changes:

1. server/middleware/setup.js
   - Add static asset and SPA route bypass for authentication
   - Prevents auth middleware from blocking HTML pages and assets
   - Environment-aware: dev-specific paths only in development

2. server/routes/staticRoutes.js
   - Add file extension check to catch-all route
   - Return 404 for missing static assets instead of serving index.html
   - Prevents misrouted asset requests from getting HTML responses

3. client/index.html
   - Fix base tag detection for root-level routes
   - When route detected at index 0, set basePath to '/' instead of ''
   - Always create base tag to ensure proper asset resolution
   - Still supports subdirectory deployments dynamically

Result: Direct navigation to any route now works correctly with proper
asset loading, while maintaining subdirectory deployment support.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@github-actions
Copy link
Contributor

🔧 Auto-fix applied: Lint and format issues have been automatically fixed and committed to this PR.

@manzke manzke merged commit b25e4eb into main Nov 13, 2025
3 checks passed
@manzke manzke deleted the fix/oidc-static-assets-auth branch November 13, 2025 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants