Skip to content

fix: CORS error and restore PWA manifest functionality respecting auth redirects for subpath deployments.#63

Open
pantierra wants to merge 1 commit intomainfrom
fix/web-manifests
Open

fix: CORS error and restore PWA manifest functionality respecting auth redirects for subpath deployments.#63
pantierra wants to merge 1 commit intomainfrom
fix/web-manifests

Conversation

@pantierra
Copy link
Contributor

Currently I get an error like this:

https://eoapi.develop.eoepca.org/manager/meta/manifest.webmanifest' 
from origin 'https://eoapi.develop.eoepca.org' has been blocked by CORS policy: 
Cross origin requests are only supported for protocol schemes: chrome, 
chrome-extension, chrome-untrusted, data, http, https, isolated-app.

This PR attempt to fix this CORS error and PWA manifest functionality for subpath deployments by changing how PUBLIC_URL is handled:

  • Build time: Use / as PUBLIC_URL and convert hardcoded paths to runtime placeholders
  • Runtime: Replace placeholders with actual deployment path via docker-entrypoint.sh
  • Auth redirects: Added getBasePath() and getRedirectUri() utilities to properly handle Keycloak redirects for subpath deployments

This ensures manifest files, assets, and authentication work correctly whether deployed at root (/) or a subpath (/manager/).

@pantierra pantierra requested a review from danielfdsilva March 6, 2026 13:57
@pantierra pantierra force-pushed the fix/web-manifests branch from ad17356 to e29b0df Compare March 6, 2026 13:58
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