Merge pull request #3092 from shubhamkumar9199/fix/oauth-url-undefined-environment

WEB-667 fix(env): prevent undefinedundefined in oauthServerUrl
This commit is contained in:
Gopi Kishan 2026-02-05 02:39:38 +05:30 committed by GitHub
commit ad99027843
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -11,6 +11,8 @@ import env from './.env';
// The `window['env']` object is loaded in the `index.html` file
const loadedEnv = window['env'] || {};
const base = loadedEnv['fineractApiUrl'];
const provider = loadedEnv['apiProvider'];
export const environment = {
production: true,
@ -27,7 +29,7 @@ export const environment = {
baseApiUrl:
loadedEnv['fineractApiUrl'] ||
(loadedEnv['fineractApiUrls']?.length > 0 ? loadedEnv['fineractApiUrls'].split(',')[0] : window.location.origin),
oauthServerUrl: loadedEnv['oauthServerUrl'] || loadedEnv['fineractApiUrl'] + loadedEnv['apiProvider'],
oauthServerUrl: loadedEnv['oauthServerUrl'] ?? (base && provider ? `${base}${provider}` : ''),
allowServerSwitch: loadedEnv.allowServerSwitch || 'true',
apiProvider: loadedEnv['apiProvider'] || '/fineract-provider/api',
apiVersion: loadedEnv['apiVersion'] || '/v1',