Commit 0ca60338 authored by Lauri Himanen's avatar Lauri Himanen
Browse files

Removed guiRoot from config, reading it from window.location instead.

parent fea1a6b1
Pipeline #85810 skipped with stage
This source diff could not be displayed because it is too large. You can view the blob instead.
window.nomadEnv = {
//apiRoot: "https://labdev-nomad.esc.rzg.mpg.de/dev/nomad/encyclopedia-api/",
//guiRoot: "https://labdev-nomad.esc.rzg.mpg.de/dev/nomad/encyclopedia-api/",
apiRoot: "https://nomad-lab.eu/prod/rae/api/encyclopedia/",
guiRoot: "https://nomad-lab.eu/prod/rae/encyclopedia/",
//guiRoot: "http://localhost:3000/gui/",
//apiRoot: "http://localhost:8000/fairdi/nomad/latest/api/encyclopedia/",
keycloakBase: 'https://nomad-lab.eu/fairdi/keycloak/auth/',
keycloakRealm: 'fairdi_nomad_test',
......
......@@ -42,6 +42,9 @@ let contentElement = document.getElementById('content');
let titleElement = document.querySelector('title');
window.allowNewLoadPopup = true;
var getUrl = window.location;
var guiRoot = getUrl.protocol + "//" + getUrl.host + "/" + getUrl.pathname;
// As of 0.8.3 nomad-FAIR is using KeyCloak 7.0.0, which does
// not support the "silentCheckSsoRedirectUri" option. This option enables a
// silent login check that does not enforce reloads. In order to do such silent
......@@ -72,7 +75,7 @@ let logoutButton = document.querySelector('#logout-button');
let userName = document.querySelector('#user-name');
keycloak.init({
onLoad: "check-sso",
silentCheckSsoRedirectUri: `${window.nomadEnv.guiRoot}silent-check-sso.html`,
silentCheckSsoRedirectUri: `${guiRoot}silent-check-sso.html`,
promiseType: "native",
}).then((authenticated) => {
if (authenticated) {
......@@ -93,7 +96,7 @@ keycloak.init({
}
});
loginButton.onclick = () => {
keycloak.login({redirectUri: `${window.nomadEnv.guiRoot}#/search`})
keycloak.login({redirectUri: `${guiRoot}#/search`})
.catch(() => {console.log("Authentication error.");});
};
logoutButton.onclick = () => {
......
......@@ -33,8 +33,8 @@ let InfoSys = require('../common/InfoSys.js');
let DataStore = require('./DataStore.js');
let SortingButton = require('./SortingButton.js');
let guiRoot = window.nomadEnv.guiRoot;
var getUrl = window.location;
var guiRoot = getUrl.protocol + "//" + getUrl.host + "/" + getUrl.pathname;
let REPOSITORY_LINK = guiRoot.slice(0, guiRoot.lastIndexOf('/', guiRoot.lastIndexOf('/')-1))+"/gui/entry/id"
const calcTypesMap = new Map([
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment