Commit a8382fd0 authored by Lauri Himanen's avatar Lauri Himanen
Browse files

Simplified config.

parent 44ccbaab
Pipeline #79121 skipped with stage
This diff is collapsed.
window.nomadEnv = {
//host: "https://labdev-nomad.esc.rzg.mpg.de/dev/nomad/encyclopedia-api/",
//path: "api/encyclopedia/",
//apiRoot: "https://labdev-nomad.esc.rzg.mpg.de/dev/nomad/encyclopedia-api/",
//guiRoot: "https://labdev-nomad.esc.rzg.mpg.de/dev/nomad/encyclopedia-api/",
//userCookieDomain: ".esc.rzg.mpg.de",
host: "https://nomad-lab.eu/prod/rae/",
path: "api/encyclopedia/",
userCookieDomain: ".nomad-lab.eu",
//host: "/",
//path: "",
apiRoot: "https://nomad-lab.eu/prod/rae/api/encyclopedia/",
//guiRoot: "https://nomad-lab.eu/prod/rae/encyclopedia/",
guiRoot: "http://localhost:3000/gui/",
//apiRoot: "/",
//userCookieDomain: ".localhost",
guestUserToken: 'eyJhbGciOiJIUzI1NiIsImlhdCI6MTUyMzg4MDE1OSwiZXhwIjoxNjgxNTYwMTU5fQ.ey'+
'JpZCI6ImVuY2d1aSJ9.MsMWQa3IklH7cQTxRaIRSF9q8D_2LD5Fs2-irpWPTp4',
......
......@@ -18,7 +18,7 @@ let logoutButton = document.querySelector('#logout-button');
let userName = document.querySelector('#user-name');
keycloak.init({
onLoad: "check-sso",
silentCheckSsoRedirectUri: "http://localhost:3000/gui/silent-check-sso.html",
silentCheckSsoRedirectUri: `${window.nomadEnv.guiRoot}silent-check-sso.html`,
promiseType: "native",
}).then((authenticated) => {
if (authenticated) {
......@@ -37,7 +37,7 @@ keycloak.init({
}
});
loginButton.onclick = () => {
keycloak.login({redirectUri: "http://" + window.location.host + "/gui/#/search"})
keycloak.login({redirectUri: `${window.nomadEnv.guiRoot}#/search`})
.catch(() => {console.log("Authentication error.")})
};
logoutButton.onclick = () => {
......
......@@ -64,7 +64,7 @@ let ELEMENTS = [
];
// API URL and user cookie domain configuration
const API_BASE_URL = window.nomadEnv.host + window.nomadEnv.path;
const API_BASE_URL = window.nomadEnv.apiRoot;
// Mockup URLs
//const FERMI_SURFACE_URL= HOST+'files/fermi/'+
......
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