From 6119a7cadf72c3452f6808b7f2d8b308cbeca922 Mon Sep 17 00:00:00 2001 From: Felix Albrigtsen Date: Sat, 23 Apr 2022 14:56:33 +0200 Subject: [PATCH] Updated login logic --- src/client/src/FrontPage.js | 4 +++- src/client/src/ProfilePage.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/client/src/FrontPage.js b/src/client/src/FrontPage.js index 062d5ea..6321fea 100644 --- a/src/client/src/FrontPage.js +++ b/src/client/src/FrontPage.js @@ -224,7 +224,9 @@ class LoginManager { } isLoggedIn() { - return this.user.googleId !== undefined && this.user.googleId !== "" && this.user.asuraId !== undefined && this.user.asuraId !== -1; + let loggedIn = this.user.googleId !== "" && this.user.asuraId !== -1; + console.log(loggedIn); + return loggedIn; } isManager() { return this.isLoggedIn() && this.user.isManager; diff --git a/src/client/src/ProfilePage.js b/src/client/src/ProfilePage.js index 4a9b09c..39bdd3d 100644 --- a/src/client/src/ProfilePage.js +++ b/src/client/src/ProfilePage.js @@ -21,7 +21,7 @@ export default function ProfilePage(props) {

Name: {user.name}

Email: {user.email}

-

Role: {user.isManager() ? "Manager" : "Administrator"}

+

Role: {props.login.isManager() ? "Manager" : "Administrator"}

Picture: Your profile