From 80c33f5303e2c083841933de4338f7e5d15de972 Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Mon, 3 Apr 2017 09:20:59 +0200 Subject: Factor out hardcoded SERVER_BASE_URL --- src/scripts/user.ts | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'src/scripts/user.ts') 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?"); } }); }; -- cgit v1.2.3