Updated login logic
This commit is contained in:
parent
a9848ae0ad
commit
6119a7cadf
|
@ -224,7 +224,9 @@ class LoginManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
isLoggedIn() {
|
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() {
|
isManager() {
|
||||||
return this.isLoggedIn() && this.user.isManager;
|
return this.isLoggedIn() && this.user.isManager;
|
||||||
|
|
|
@ -21,7 +21,7 @@ export default function ProfilePage(props) {
|
||||||
<Box>
|
<Box>
|
||||||
<h3><b>Name: </b> {user.name}</h3>
|
<h3><b>Name: </b> {user.name}</h3>
|
||||||
<h3><b>Email: </b> {user.email}</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>
|
<h3><b>Picture: </b> <img src={user.imgURL} alt="Your profile"></img></h3>
|
||||||
</Box>
|
</Box>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue