diff --git a/app/config/src/version.js b/app/config/src/version.js index 95391ada5..2980ee4fd 100644 --- a/app/config/src/version.js +++ b/app/config/src/version.js @@ -5,3 +5,4 @@ window.versioningEnabled = true; window.makeOpenEnabled = true; window.categoryTreeEnabled = true; window.dataciteEnabled = dataciteEnabledValue; +window.authBase = "authBaseValue"; diff --git a/app/scripts/handlers/KeycloakUserHandler.js b/app/scripts/handlers/KeycloakUserHandler.js index fe29f3a7e..3df2ecd68 100644 --- a/app/scripts/handlers/KeycloakUserHandler.js +++ b/app/scripts/handlers/KeycloakUserHandler.js @@ -1,8 +1,10 @@ -function KeycloakUserHandler() { +function KeycloakUserHandler(UrlService) { const keycloak = Keycloak({ "realm" : "CEDAR", - "url" : window.location.origin.replaceAll('/cedar.', '/auth.'), + "url" : window.location.origin.startsWith("http://localhost:4200") ? + window.location.origin.replaceAll("http://localhost:4200", window.authBase) : + window.location.origin.replaceAll('/cedar.', '/auth.'), "clientId": "cedar-angular-app" }); diff --git a/gulpfile.js b/gulpfile.js index dd2031f86..8b8119db5 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -97,6 +97,7 @@ gulp.task('replace-url', function (done) { .pipe(replace('impexServerUrl', 'https://impex.' + cedarRestHost)) .pipe(replace('artifactsFrontendUrl', 'https://artifacts.' + cedarRestHost)) .pipe(replace('dataciteDOIBaseUrl', 'https://bridging.' + cedarRestHost + '/doi/datacite')) + .pipe(replace('authServerUrl', 'https://auth.' + cedarRestHost)) .pipe(gulp.dest('app/config/')); done(); }); @@ -115,6 +116,7 @@ gulp.task('replace-version', function (done) { .pipe(replace('cedarVersionValue', cedarVersion)) .pipe(replace('cedarVersionModifierValue', cedarVersionModifier)) .pipe(replace('dataciteEnabledValue', dataciteEnabled)) + .pipe(replace('authBaseValue', 'https://auth.' + cedarRestHost)) .pipe(gulp.dest('app/config/')); done(); });