diff --git a/frontend/.env b/frontend/.env index 569fb6a..cf7cd69 100644 --- a/frontend/.env +++ b/frontend/.env @@ -5,4 +5,7 @@ # REACT_APP_BASE_PATH_OVERRIDE=/your-custom-path # Temporarily disable Azure AD authentication for testing -REACT_APP_DISABLE_AUTH=true \ No newline at end of file +REACT_APP_DISABLE_AUTH=true + +# Optional: Explicitly set the MSAL redirect URL (overrides automatic detection) +# REACT_APP_MSAL_REDIRECT_URL=https://your-app-url.com/ \ No newline at end of file diff --git a/frontend/src/utils/pathUtils.js b/frontend/src/utils/pathUtils.js index 6567df9..b6febb8 100644 --- a/frontend/src/utils/pathUtils.js +++ b/frontend/src/utils/pathUtils.js @@ -193,6 +193,11 @@ export const getFullPath = (path = '/') => { * @returns {string} Full redirect URI */ export const getRedirectUri = (path = '/') => { + // Allow override via environment variable + if (process.env.REACT_APP_MSAL_REDIRECT_URL) { + console.log('PathUtils: Using configured redirect URL from env:', process.env.REACT_APP_MSAL_REDIRECT_URL); + return process.env.REACT_APP_MSAL_REDIRECT_URL; + } return getFullUrl(path); };