feat: allow MSAL redirect URL override via env var

This commit is contained in:
michael 2025-11-20 08:13:33 -06:00
parent 00ca5a4c58
commit 4d5154c915
2 changed files with 9 additions and 1 deletions

View file

@ -5,4 +5,7 @@
# REACT_APP_BASE_PATH_OVERRIDE=/your-custom-path
# Temporarily disable Azure AD authentication for testing
REACT_APP_DISABLE_AUTH=true
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/

View file

@ -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);
};