Updated login logic

This commit is contained in:
Felix Albrigtsen 2022-04-23 14:56:33 +02:00
parent a9848ae0ad
commit 6119a7cadf
2 changed files with 4 additions and 2 deletions

View File

@ -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;

View File

@ -21,7 +21,7 @@ export default function ProfilePage(props) {
<Box>
<h3><b>Name: </b> {user.name}</h3>
<h3><b>Email: </b> {user.email}</h3>
<h3><b>Role: </b> {user.isManager() ? "Manager" : "Administrator"}</h3>
<h3><b>Role: </b> {props.login.isManager() ? "Manager" : "Administrator"}</h3>
<h3><b>Picture: </b> <img src={user.imgURL} alt="Your profile"></img></h3>
</Box>
</div>