Skip to content

Commit

Permalink
Merge pull request #3 from icefoganalytics/main
Browse files Browse the repository at this point in the history
Auth fix for production
  • Loading branch information
datajohnson authored Apr 19, 2024
2 parents 3648bdf + d3a49f7 commit 9c5a612
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
13 changes: 10 additions & 3 deletions src/web/auth-config.json
Original file line number Diff line number Diff line change
@@ -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": "Li7cgKJiWZSxhjCQp2Gco1mGDcsO7WuU",
"audience": "generic-production",
"domain": "https://sign-in.service.yukon.ca"
}
}
12 changes: 8 additions & 4 deletions src/web/src/plugins/auth.ts
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down

0 comments on commit 9c5a612

Please sign in to comment.