diff --git a/TEST_GUIDE.md b/TEST_GUIDE.md index 98dc982..aa79575 100644 --- a/TEST_GUIDE.md +++ b/TEST_GUIDE.md @@ -60,23 +60,7 @@ Please test each step in order and report any errors (console errors, wrong text ## Admin & Host Features -For these steps you need an admin session. Log in via the admin API (or use the curl command below): - -```bash -curl -s -X POST http://localhost:3000/api/v1/admin/login \ - -H 'Content-Type: application/json' \ - -d '{"password":"admin123"}' | python3 -m json.tool -``` - -Copy the `jwt` value — you'll need it for the Authorization header in curl commands. -To use the admin dashboard in the browser, paste the token into DevTools console: - -```js -localStorage.setItem('token', ''); -localStorage.setItem('role', 'admin'); -``` - -Then navigate to **http://localhost:5173/admin**. +For these steps you need an admin session. Go to **http://localhost:5173/admin/login** and enter the admin password (`admin123` for the dev environment). You'll be redirected to the dashboard automatically. ### Step 10 — Admin Dashboard: Stats & Config 1. Go to **http://localhost:5173/admin** diff --git a/frontend/src/routes/admin/+page.svelte b/frontend/src/routes/admin/+page.svelte index 065ba95..b32a77d 100644 --- a/frontend/src/routes/admin/+page.svelte +++ b/frontend/src/routes/admin/+page.svelte @@ -47,7 +47,7 @@ const token = getToken(); const role = getRole(); if (!token || role !== 'admin') { - goto('/join'); + goto('/admin/login'); return; } await reload(); diff --git a/frontend/src/routes/admin/login/+page.svelte b/frontend/src/routes/admin/login/+page.svelte new file mode 100644 index 0000000..6bb1f0c --- /dev/null +++ b/frontend/src/routes/admin/login/+page.svelte @@ -0,0 +1,68 @@ + + +
+
+

Admin-Login

+

Nur für Veranstalter

+ +
{ e.preventDefault(); handleLogin(); }}> + + + {#if error} +

{error}

+ {/if} + + +
+ +

+ Zurück zum Event +

+
+