Added link to admin panel

Resolved #11
This commit is contained in:
2021-03-12 13:32:19 +11:00
parent d66d0bc9da
commit 8a920c5316
4 changed files with 21 additions and 10 deletions
+11 -2
View File
@@ -7,7 +7,7 @@ const Visitor = () => {
return (
<div>
<Link to='/signup'>Sign Up</Link>
<em> - </em>
<span> - </span>
<Link to='/login'>Log In</Link>
</div>
);
@@ -19,7 +19,16 @@ const Member = () => {
return (
<div>
<Link to='/account'>Account</Link>
<em> - </em>
<span> - </span>
{ authTokens.getPayload().privilege == 'administrator' ?
<span>
<Link to='/admin'>Admin</Link>
<span> - </span>
</span>:
<span />
}
{ /* Logout button logs you out of the server too */ }
<Link to='/' onClick={async () => {
const result = await authTokens.tokenFetch(`${process.env.AUTH_URI}/logout`, { //NOTE: this gets overwritten as a bugfix