From d1cef4a07e9ff91080915a09686761fc56c5a0f2 Mon Sep 17 00:00:00 2001 From: Andy Lin Date: Wed, 30 Jun 2021 11:34:59 +0800 Subject: [PATCH] removed debugging outputs --- frontend/src/App.js | 2 +- frontend/src/_services/request.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/App.js b/frontend/src/App.js index b787fee..fa99092 100644 --- a/frontend/src/App.js +++ b/frontend/src/App.js @@ -165,7 +165,7 @@ class App extends Component { * @returns 0 if login successful, -1 if login failure */ async login(user) { - console.log("App.js - login - store.getState() = ", store.getState()); + // console.log("App.js - login - store.getState() = ", store.getState()); return AuthService.login(user).then((response) => { if (response.message) { // When the API returns `message`, that means the login has failed diff --git a/frontend/src/_services/request.js b/frontend/src/_services/request.js index e65c6f0..7b48ee5 100644 --- a/frontend/src/_services/request.js +++ b/frontend/src/_services/request.js @@ -24,7 +24,7 @@ const client = axios.create({ const request = function (options) { let isLoggedIn = null; if (options.headers) - isLoggedIn = options.headers["Authorization"] === "Bearer"; // TODO: change to starts with? + isLoggedIn = options.headers["Authorization"].startsWith("Bearer "); // TODO: change to starts with? console.log("isLoggedIn = ", isLoggedIn ? "true" : "false");