summaryrefslogtreecommitdiff
path: root/src/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'src/scripts')
-rw-r--r--src/scripts/controllers/connection/socket.ts2
-rw-r--r--src/scripts/splash.entry.ts4
-rw-r--r--src/scripts/user.ts17
3 files changed, 5 insertions, 18 deletions
diff --git a/src/scripts/controllers/connection/socket.ts b/src/scripts/controllers/connection/socket.ts
index c23495f1..91a0f9e4 100644
--- a/src/scripts/controllers/connection/socket.ts
+++ b/src/scripts/controllers/connection/socket.ts
@@ -15,7 +15,7 @@ export class SocketController {
this.callbacks = {};
this._cacheController = new CacheController();
- this._socket = io.connect('https://opendc.ewi.tudelft.nl:443');
+ this._socket = io.connect('SERVER_BASE_URL');
this._socket.on('connect', onConnect);
this._socket.on('response', (jsonResponse: string) => {
diff --git a/src/scripts/splash.entry.ts b/src/scripts/splash.entry.ts
index 700f52bb..6abd9518 100644
--- a/src/scripts/splash.entry.ts
+++ b/src/scripts/splash.entry.ts
@@ -119,7 +119,7 @@ window["renderButton"] = () => {
// Calculate token expiration time (in seconds since epoch)
const expirationTime = (new Date()).getTime() / 1000 + googleUser.getAuthResponse().expires_in - 5;
- $.post('https://opendc.ewi.tudelft.nl/tokensignin', {
+ $.post('SERVER_BASE_URL/tokensignin', {
idtoken: id_token
}, (data: any) => {
// Save user information in session storage for later use on other pages
@@ -146,7 +146,7 @@ window["renderButton"] = () => {
});
},
'onfailure': () => {
- console.log("Oops, something went wrong with your Google signin... Try again?")
+ console.log("Oops, something went wrong with your Google signin... Try again?");
}
});
};
diff --git a/src/scripts/user.ts b/src/scripts/user.ts
index 66e44b21..e9d13091 100644
--- a/src/scripts/user.ts
+++ b/src/scripts/user.ts
@@ -2,24 +2,11 @@
import * as $ from "jquery";
-const LOCAL_MODE = (document.location.hostname === "localhost");
-
// Redirect the user to the splash page, if not signed in
-if (!LOCAL_MODE && localStorage.getItem("googleToken") === null) {
+if (localStorage.getItem("googleToken") === null) {
window.location.replace("/");
}
-// Fill session storage with mock data during LOCAL_MODE
-if (LOCAL_MODE) {
- localStorage.setItem("googleToken", "");
- localStorage.setItem("googleTokenExpiration", "2000000000");
- localStorage.setItem("googleName", "John Doe");
- localStorage.setItem("googleEmail", "john@doe.com");
- localStorage.setItem("userId", "2");
- localStorage.setItem("simulationId", "1");
- localStorage.setItem("simulationAuthLevel", "OWN");
-}
-
// Set the username in the navbar
$("nav .user .username").text(localStorage.getItem("googleName"));
@@ -59,7 +46,7 @@ window["gapiSigninButton"] = () => {
},
'onfailure': () => {
window.location.href = "/";
- console.log("Oops, something went wrong with your Google signin... Try again?")
+ console.log("Oops, something went wrong with your Google signin... Try again?");
}
});
};