feat: auth-aware UI and role-based access control (#67)
## Summary
- Add `is_admin` column to users table with Alembic migration and a `require_admin` FastAPI dependency that protects all admin-facing write endpoints (games, pokemon, evolutions, bosses, routes CRUD)
- Expose admin status to frontend via user API and update AuthContext to fetch/store `isAdmin` after login
- Make navigation menu auth-aware (different links for logged-out, logged-in, and admin users) and protect frontend routes with `ProtectedRoute` and `AdminRoute` components, preserving deep-linking through redirects
- Fix test reliability: `drop_all` before `create_all` to clear stale PostgreSQL enums from interrupted test runs
- Fix test auth: add `admin_client` fixture and use valid UUID for mock user so tests pass with new admin-protected endpoints
## Test plan
- [x] All 252 backend tests pass
- [ ] Verify non-admin users cannot access admin write endpoints (games, pokemon, evolutions, bosses CRUD)
- [ ] Verify admin users can access admin endpoints normally
- [ ] Verify navigation shows correct links for logged-out, logged-in, and admin states
- [ ] Verify `/admin/*` routes redirect non-admin users with a toast
- [ ] Verify `/runs/new` and `/genlockes/new` redirect unauthenticated users to login, then back after auth
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Reviewed-on: https://gitea.nerdboden.de/pokemon/nuzlocke-tracker/pulls/67
Co-authored-by: Julian Tabel <juliantabel.jt@gmail.com>
Co-committed-by: Julian Tabel <juliantabel.jt@gmail.com>
2026-03-21 11:44:05 +01:00
|
|
|
export { AdminRoute } from './AdminRoute'
|
2026-03-20 15:09:02 +01:00
|
|
|
export { CustomRulesDisplay } from './CustomRulesDisplay'
|
2026-03-20 21:41:38 +01:00
|
|
|
export { ProtectedRoute } from './ProtectedRoute'
|
2026-02-08 22:25:47 +01:00
|
|
|
export { EggEncounterModal } from './EggEncounterModal'
|
2026-02-07 14:20:26 +01:00
|
|
|
export { EncounterMethodBadge } from './EncounterMethodBadge'
|
2026-02-05 15:28:50 +01:00
|
|
|
export { EncounterModal } from './EncounterModal'
|
2026-02-07 13:12:56 +01:00
|
|
|
export { EndRunModal } from './EndRunModal'
|
2026-02-05 15:09:25 +01:00
|
|
|
export { GameCard } from './GameCard'
|
2026-02-09 11:00:37 +01:00
|
|
|
export { GenlockeGraveyard } from './GenlockeGraveyard'
|
2026-02-09 11:58:38 +01:00
|
|
|
export { GenlockeLineage } from './GenlockeLineage'
|
2026-02-09 10:19:56 +01:00
|
|
|
export { HofTeamModal } from './HofTeamModal'
|
2026-02-05 15:09:25 +01:00
|
|
|
export { GameGrid } from './GameGrid'
|
2026-02-04 17:13:58 +01:00
|
|
|
export { Layout } from './Layout'
|
2026-02-05 15:28:50 +01:00
|
|
|
export { PokemonCard } from './PokemonCard'
|
|
|
|
|
export { RuleBadges } from './RuleBadges'
|
2026-02-07 21:08:25 +01:00
|
|
|
export { ShinyBox } from './ShinyBox'
|
|
|
|
|
export { ShinyEncounterModal } from './ShinyEncounterModal'
|
2026-02-05 18:36:08 +01:00
|
|
|
export { StatusChangeModal } from './StatusChangeModal'
|
2026-02-09 11:20:49 +01:00
|
|
|
export { TransferModal } from './TransferModal'
|
2026-02-04 17:13:58 +01:00
|
|
|
export { RuleToggle } from './RuleToggle'
|
|
|
|
|
export { RulesConfiguration } from './RulesConfiguration'
|
2026-02-05 15:28:50 +01:00
|
|
|
export { StatCard } from './StatCard'
|
2026-02-05 15:09:25 +01:00
|
|
|
export { StepIndicator } from './StepIndicator'
|
2026-02-07 21:12:45 +01:00
|
|
|
export { TypeBadge } from './TypeBadge'
|