Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion frontend/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
Cache-Control "no-store, no-cache, must-revalidate, proxy-revalidate"
X-Content-Type-Options "nosniff"
Strict-Transport-Security "max-age=31536000"
# connect-src must include the regional Cognito IdP host (cognito-idp.<region>.amazonaws.com):
# Amplify calls it for SILENT TOKEN REFRESH. Without it the browser blocks the refresh, the
# access/id token expires at its TTL, the next request 401s and the user is signed out
# mid-session. The Hosted UI domain below only covers the OAuth login redirect, not refresh.
Content-Security-Policy "default-src 'self' https://*.gov.bc.ca;
script-src 'self' https://*.gov.bc.ca;
style-src 'self' https://fonts.googleapis.com https://use.fontawesome.com 'unsafe-inline';
Expand All @@ -49,7 +53,7 @@
frame-ancestors 'self';
form-action 'self';
block-all-mixed-content;
connect-src 'self' https://*.gov.bc.ca wss://*.gov.bc.ca https://{$COGNITO_DOMAIN:lza-prod-fam-user-pool-domain.auth.ca-central-1.amazoncognito.com};"
connect-src 'self' https://*.gov.bc.ca wss://*.gov.bc.ca https://{$COGNITO_DOMAIN:lza-prod-fam-user-pool-domain.auth.ca-central-1.amazoncognito.com} https://cognito-idp.{$COGNITO_REGION:ca-central-1}.amazonaws.com;"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This keeps the existing Hosted UI allow-list entry and adds the regional Cognito IdP host alongside it, which matches the two separate Amplify flows described in the PR. The defaulted region placeholder also avoids requiring a deployment change for the current FAM environments while leaving an explicit override when needed.

Referrer-Policy "same-origin"
Permissions-Policy "fullscreen=(self), camera=(), microphone=()"
Cross-Origin-Resource-Policy "same-origin"
Expand Down
Loading