summaryrefslogtreecommitdiff
path: root/src/scripts/user.ts
diff options
context:
space:
mode:
authorGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-04-03 09:20:59 +0200
committerGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-04-03 09:20:59 +0200
commit80c33f5303e2c083841933de4338f7e5d15de972 (patch)
treeaea30c99000290ae590591ecb614dc84e793cdf2 /src/scripts/user.ts
parentf7518a4d196ccf9e3ef16829d4129fbb44242726 (diff)
Factor out hardcoded SERVER_BASE_URL
Diffstat (limited to 'src/scripts/user.ts')
-rw-r--r--src/scripts/user.ts17
1 files changed, 2 insertions, 15 deletions
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?");
}
});
};