summaryrefslogtreecommitdiff
path: root/src/scripts/user.ts
diff options
context:
space:
mode:
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?");
}
});
};