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