| Metadata | Value |
|---|---|
| Status | Completed |
| Version | 1.0.0 |
| Last Updated | 2026-01-27 |
| Author | Antigravity |
Implement a simple but secure authentication mechanism for the Admin Dashboard to replace the previous bypassing “dev-admin-token” logic. This involves creating a proper Login UI, ensuring the API client handles authentication correctly via JWTs, and providing a consistent developer experience for local setup.
/login route that accepts an Admin Token and User UUID.login function in the client must POST to /auth/token and store the received JWT./login and protect other routes (implicitly or explicitly).Login.tsx page component.
client.ts.
login function.request function uses the stored authToken.App.tsx.
/login route.useEffect that was auto-setting the invalid token.database/seed_data/01_reference_data.sql.
gen_random_uuid() so ID is stable per DB, idempotent across re-seeds (ON CONFLICT on email).SELECT id FROM users WHERE email = 'admin@sangitagrantha.org' so no hard-coded UUID./login, enter dev-admin-token and the admin user’s UUID (from SELECT id FROM users WHERE email = 'admin@sangitagrantha.org').