use variable schemeName in getEnvVar for client creds

This commit is contained in:
Dave Kerr 2025-05-07 11:24:39 -04:00
parent 809f2a9735
commit a770d208f8

View File

@ -109,9 +109,9 @@ declare global {
async function acquireOAuth2Token(schemeName: string, scheme: any): Promise<string | null | undefined> {
try {
// Check if we have the necessary credentials
const clientId = process.env[\`${getEnvVarName('schemeName', 'OAUTH_CLIENT_ID')}\`];
const clientSecret = process.env[\`${getEnvVarName('schemeName', 'OAUTH_CLIENT_SECRET')}\`];
const scopes = process.env[\`${getEnvVarName('schemeName', 'OAUTH_SCOPES')}\`];
const clientId = process.env[\`${getEnvVarName(schemeName, 'OAUTH_CLIENT_ID')}\`];
const clientSecret = process.env[\`${getEnvVarName(schemeName, 'OAUTH_CLIENT_SECRET')}\`];
const scopes = process.env[\`${getEnvVarName(schemeName, 'OAUTH_SCOPES')}\`];
if (!clientId || !clientSecret) {
console.error(\`Missing client credentials for OAuth2 scheme '\${schemeName}'\`);