diff --git a/README.md b/README.md index 7675852..ff8d1f8 100644 --- a/README.md +++ b/README.md @@ -47,19 +47,19 @@ To set up this template in development mode: - Logging in and out - Account deletion - Password management -- Fully Featured Administration Panel - - A default admin account (if desired) + - JSON web token authentication - News Blog - Optional microservice - - Secure publishing and editing of articles -- Easy To Use Configuraton Script: - - ~~Default UUID keys~~ - - ~~Docker, docker, docker.~~ + - Secure publishing and editing of articles via admin panel +- Easy To Use Configuraton Script + - Sets up everything via docker + - A default admin account (if desired) # Coming Soon - Full documentation - Setup tutorial + - Modding tutorial - Fully Featured Chat System - Optional microservice - Chat logs diff --git a/client/components/pages/account.jsx b/client/components/pages/account.jsx index a6ff3eb..a529a45 100644 --- a/client/components/pages/account.jsx +++ b/client/components/pages/account.jsx @@ -39,12 +39,14 @@ const Account = props => {

Account

{ evt.preventDefault(); - const [err, result] = await update(passwordRef.current.value, retypeRef.current.value, contactRef.current.checked, authTokens.tokenFetch); + const [err] = await update(passwordRef.current.value, retypeRef.current.value, contactRef.current.checked, authTokens.tokenFetch); if (err) { alert(err); return; } + + alert('Details updated'); passwordRef.current.value = retypeRef.current.value = ''; }}>
diff --git a/client/components/pages/admin.jsx b/client/components/pages/admin.jsx index f620d94..7ec0d12 100644 --- a/client/components/pages/admin.jsx +++ b/client/components/pages/admin.jsx @@ -11,7 +11,7 @@ const Admin = props => { const authTokens = useContext(TokenContext); //misplaced? (admin only) - if (!authTokens.accessToken || !authTokens.getPayload().privilege == 'administrator') { + if (!authTokens.accessToken || authTokens.getPayload().privilege != 'administrator') { return ; } diff --git a/client/components/panels/header.jsx b/client/components/panels/header.jsx index e420a23..430df8d 100644 --- a/client/components/panels/header.jsx +++ b/client/components/panels/header.jsx @@ -7,7 +7,7 @@ const Visitor = () => { return (
Sign Up - - + - Log In
); @@ -19,7 +19,16 @@ const Member = () => { return (
Account - - + - + + { authTokens.getPayload().privilege == 'administrator' ? + + Admin + - + : + + } + { /* Logout button logs you out of the server too */ } { const result = await authTokens.tokenFetch(`${process.env.AUTH_URI}/logout`, { //NOTE: this gets overwritten as a bugfix