Skip to content

Commit

Permalink
fixed the redirectSignOut using the env vars to dynamically create lo…
Browse files Browse the repository at this point in the history
…gout url (#75)

* fixed the redirectSignOut using the env vars to dynamically create logout url

* shorten the URL with variables

* fix: poold and webclient ids fixes and add zone on docker compose

---------

Co-authored-by: Derek Roberts <[email protected]>
Co-authored-by: Ricardo Campos <[email protected]>
  • Loading branch information
3 people authored Aug 30, 2023
1 parent 6899ac4 commit 0543283
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 3 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ version: '3.9'

x-common: &common
environment:
REACT_APP_USER_POOLS_ID: ca-central-1_t2HSZBHurS
REACT_APP_USER_POOLS_WEB_CLIENT_ID: 37798cpec8d4u1a2njt02nonp7
REACT_APP_USER_POOLS_ID: ca-central-1_t2HSZBHur
REACT_APP_USER_POOLS_WEB_CLIENT_ID: 3g6n2ha1loi4kp1jhaq359vrvb
REACT_APP_AWS_DOMAIN: prod-fam-user-pool-domain.auth.ca-central-1.amazoncognito.com
REACT_APP_ZONE: DEV
healthcheck:
test: [ "CMD-SHELL", "curl http://localhost:3000" ]
interval: 15s
Expand Down
7 changes: 6 additions & 1 deletion frontend/src/aws-exports.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { env } from './env';

const ZONE = env.REACT_APP_ZONE.toLocaleLowerCase();
const retUrl = window.location.origin;
const logoutDomain = `https://logon${ZONE === "prod"?'':'test'}7.gov.bc.ca/`;


const awsconfig = {
aws_cognito_region: env.REACT_APP_COGNITO_REGION || "ca-central-1",
aws_user_pools_id: env.REACT_APP_USER_POOLS_ID,
Expand All @@ -9,7 +14,7 @@ const awsconfig = {
domain: env.REACT_APP_AWS_DOMAIN || "prod-fam-user-pool-domain.auth.ca-central-1.amazoncognito.com",
scope: ['openid'],
redirectSignIn: `${window.location.origin}/dashboard`,
redirectSignOut: env.REACT_APP_REDIRECT_SIGN_OUT || "https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi?retnow=1&returl=https://dev.loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/logout?redirect_uri=http://localhost:3000/",
redirectSignOut: env.REACT_APP_REDIRECT_SIGN_OUT || `${logoutDomain}/clp-cgi/logoff.cgi?retnow=1&returl=https://${ZONE}.loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/logout?redirect_uri=${retUrl}/`,
responseType: 'code',
},
federationTarget: 'COGNITO_USER_POOLS',
Expand Down

0 comments on commit 0543283

Please sign in to comment.