myheats

Live heats, scoring and leaderboard for sport events
git clone https://git.in0rdr.ch/myheats.git
Log | Files | Refs | Pull requests | README | LICENSE

commit b6b1bc3e8bfbfe829b0eae04ac6386c6814bd866
parent d28d306354ed6d06539f432577dbed5a543457bd
Author: Andreas Gruhler <andreas.gruhler@adfinis.com>
Date:   Mon, 30 Sep 2024 07:48:27 +0200

fix(settings): don't auth setting retrieval

Diffstat:
Msrc/api/server.cjs | 4+---
Msrc/frontend/App.jsx | 7+------
2 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/src/api/server.cjs b/src/api/server.cjs @@ -73,7 +73,7 @@ const paths = [ '/v1/leaderboard/removeAthleteFromHeat', // 🔒 authenticated '/v1/leaderboard/addAthlete', // 🔒 authenticated '/v1/leaderboard/removeAthlete', // 🔒 authenticated - '/v1/leaderboard/allSettings', // 🔒 authenticated + '/v1/leaderboard/allSettings', '/v1/leaderboard/getSetting', // 🔒 authenticated '/v1/leaderboard/updateSetting', // 🔒 authenticated '/v1/leaderboard/removeSetting', // 🔒 authenticated @@ -191,8 +191,6 @@ server.on('request', async (req, res) => { break case '/v1/leaderboard/allSettings': try { - await verifyToken(req, token) - const settings = await db.allSettings() if (settings.length < 1) { diff --git a/src/frontend/App.jsx b/src/frontend/App.jsx @@ -36,12 +36,7 @@ function Layout() { useEffect(() => { (async () => { - const res = await fetch(`${api_uri}:${api_port}/v1/leaderboard/allSettings`, { - headers: { - 'Content-Type': 'application/json', - 'Authorization': `Bearer ${session.auth.token}`, - } - }) + const res = await fetch(`${api_uri}:${api_port}/v1/leaderboard/allSettings`) if (res.status !== 204) { const { data, error } = await res.json() if (error) {