feat: add /admin/login page (v0.14.0)

Password form at /admin/login that calls POST /api/v1/admin/login and
redirects to /admin on success. Admin dashboard now redirects to
/admin/login instead of /join when unauthenticated. Test guide updated.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
MechaCat02
2026-04-03 19:35:40 +02:00
parent 5b2947cdbe
commit eab5bb4d1c
3 changed files with 70 additions and 18 deletions

View File

@@ -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', '<jwt>');
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**