Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
theosanderson committed May 1, 2024
1 parent 5c01e8e commit b8388a2
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions website/src/utils/clientMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,20 @@ const clientMetadata = {
};

export const getClientMetadata = () => {
const configDir = import.meta.env.CONFIG_DIR;
let backendKeycloakClientSecret;
if (typeof configDir !== 'string' || configDir === '') {
backendKeycloakClientSecret = 'dummySecret';
} else {
backendKeycloakClientSecret = getRuntimeConfig().backendKeycloakClientSecret;
}



return { ...clientMetadata, client_secret: backendKeycloakClientSecret };
return { ...clientMetadata, client_secret: getClientSecret() };
};


const getClientSecret = () => {
if (import.meta.env === undefined) {

Check failure on line 18 in website/src/utils/clientMetadata.ts

View workflow job for this annotation

GitHub Actions / Check format and types

Unnecessary conditional, the types have no overlap
return "dummySecret";
}
const configDir = import.meta.env.CONFIG_DIR;
if (typeof configDir !== 'string' || configDir === '' ){
return 'dummySecret';
}
return getRuntimeConfig().backendKeycloakClientSecret;
}

0 comments on commit b8388a2

Please sign in to comment.