From 87a55f56111e2e3b612fab4cebfb459b8a921fee Mon Sep 17 00:00:00 2001 From: Michael Johnson Date: Fri, 19 Apr 2024 13:05:18 -0700 Subject: [PATCH 1/2] Auth fix for build --- src/web/auth-config.json | 13 ++++++++++--- src/web/src/plugins/auth.ts | 12 ++++++++---- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/web/auth-config.json b/src/web/auth-config.json index cfea169..f89daa8 100644 --- a/src/web/auth-config.json +++ b/src/web/auth-config.json @@ -1,5 +1,12 @@ { - "client_id": "XnOfIQeMeSXwM7SsmLXdvZxuwpgY5lAd", - "audience": "testing", - "domain": "https://dev-0tc6bn14.eu.auth0.com" + "development": { + "client_id": "XnOfIQeMeSXwM7SsmLXdvZxuwpgY5lAd", + "audience": "testing", + "domain": "https://dev-0tc6bn14.eu.auth0.com" + }, + "production": { + "client_id": "XnOfIQeMeSXwM7SsmLXdvZxuwpgY5lAd", + "audience": "testing", + "domain": "https://dev-0tc6bn14.eu.auth0.com" + } } diff --git a/src/web/src/plugins/auth.ts b/src/web/src/plugins/auth.ts index 3350528..c7e6746 100644 --- a/src/web/src/plugins/auth.ts +++ b/src/web/src/plugins/auth.ts @@ -1,5 +1,5 @@ import { createAuth0 } from "@auth0/auth0-vue"; -import { domain, client_id, audience } from "../../auth-config.json"; +import { production, development } from "../../auth-config.json"; // The "@auth0/auth0-vue" library composables to load and manage // authentication information. In components this information is available @@ -9,11 +9,15 @@ import { domain, client_id, audience } from "../../auth-config.json"; // of the way that composables work. So, the authStore loads in @/App.vue to // work around this issue. +let config = production; + +if (window.location.host == "localhost:8080") config = development; + export const AuthHelper = createAuth0({ - domain, - clientId: client_id, + domain: config.domain, + clientId: config.client_id, authorizationParams: { - audience, + audience: config.audience, redirect_uri: window.location.origin, }, // Uncomment the following line to use the config from .env file From 08c42a36053a6057f760717bdd3136be4dbaed2b Mon Sep 17 00:00:00 2001 From: Michael Johnson Date: Fri, 19 Apr 2024 13:07:10 -0700 Subject: [PATCH 2/2] Update auth-config.json --- src/web/auth-config.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/web/auth-config.json b/src/web/auth-config.json index f89daa8..8999287 100644 --- a/src/web/auth-config.json +++ b/src/web/auth-config.json @@ -5,8 +5,8 @@ "domain": "https://dev-0tc6bn14.eu.auth0.com" }, "production": { - "client_id": "XnOfIQeMeSXwM7SsmLXdvZxuwpgY5lAd", - "audience": "testing", - "domain": "https://dev-0tc6bn14.eu.auth0.com" + "client_id": "Li7cgKJiWZSxhjCQp2Gco1mGDcsO7WuU", + "audience": "generic-production", + "domain": "https://sign-in.service.yukon.ca" } }