diff --git a/.env.production b/.env.production index 63d4663..9d7a178 100644 --- a/.env.production +++ b/.env.production @@ -3,6 +3,7 @@ VITE_CLIENTID_KEYCLOAK=VITE_CLIENTID_KEYCLOAK VITE_URL_KEYCLOAK=VITE_URL_KEYCLOAK VITE_API_URI_CONFIG=VITE_API_URI_CONFIG VITE_CLIENTSECRET_KEYCLOAK: VITE_CLIENTSECRET_KEYCLOAK +VITE_URL_SSO: VITE_URL_SSO # VITE_REALM_KEYCLOAK: "bma-ehr" # VITE_CLIENTID_KEYCLOAK: "bma-ehr-exam-vue3" diff --git a/.gitignore b/.gitignore index af75793..638ad49 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,5 @@ pnpm-debug.log* *.sln *.sw? -package-lock.json \ No newline at end of file +package-lock.json +.env \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh index 2e607be..7a63f92 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -13,6 +13,7 @@ do sed -i 's|VITE_URL_KEYCLOAK|'${VITE_URL_KEYCLOAK}'|g' $file sed -i 's|VITE_API_URI_CONFIG|'${VITE_API_URI_CONFIG}'|g' $file sed -i 's|VITE_CLIENTSECRET_KEYCLOAK|'${VITE_CLIENTSECRET_KEYCLOAK}'|g' $file + sed -i 's|VITE_URL_SSO|'${VITE_URL_SSO}'|g' $file done diff --git a/src/plugins/auth.ts b/src/plugins/auth.ts index 703ba93..0753a6e 100644 --- a/src/plugins/auth.ts +++ b/src/plugins/auth.ts @@ -1,4 +1,7 @@ const ACCESS_TOKEN = 'BMAHRISCKI_KEYCLOAK_IDENTITY' +const key_C_Config = { + url_Logout: import.meta.env.VITE_URL_SSO, +} interface AuthResponse { access_token: string @@ -15,7 +18,7 @@ async function setAuthen(r: AuthResponse) { async function logout() { await deleteCookie(ACCESS_TOKEN) - window.location.href = '/login' + window.location.href = key_C_Config.url_Logout } async function getToken() {