aboutsummaryrefslogtreecommitdiff
path: root/profile/public
diff options
context:
space:
mode:
authorLarsVomMars2021-01-29 19:13:45 +0100
committerLarsVomMars2021-01-29 19:14:12 +0100
commit153a18aaf585c459213d621f8869de2acf5f1e68 (patch)
treec89b57a88848d85c62a18241f5bbaa12ba9d81eb /profile/public
parentad8fded3d0e65d4e1c774d5da83e12030c9bf47c (diff)
Admin only profile preview
Diffstat (limited to 'profile/public')
-rw-r--r--profile/public/user.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/profile/public/user.js b/profile/public/user.js
index 936118e..84c4858 100644
--- a/profile/public/user.js
+++ b/profile/public/user.js
@@ -5,7 +5,12 @@ const charDiv = document.getElementById("char");
if (uid < 1 || uid > 119) window.location.assign("./users.html"); // Well
-function addUser(userData) {
+async function addUser(userData) {
+ const resp = await (await fetch("/auth/api/status")).json();
+ if (!resp.admin) {
+ userDiv.style.display = "none";
+ return;
+ }
const divs = [];
const questions = userData.questions;
const user = userData.user;