1015 B
1015 B
title, status, type, priority, created_at, updated_at, parent, blocked_by
| title | status | type | priority | created_at | updated_at | parent | blocked_by | |
|---|---|---|---|---|---|---|---|---|
| Backend auth middleware and JWT verification | todo | task | normal | 2026-03-20T15:28:13Z | 2026-03-20T15:28:33Z | nuzlocke-tracker-d98o |
|
Add Supabase JWT verification to the FastAPI backend. Create a reusable dependency that extracts and validates the Bearer token, resolves the current user, and provides it to endpoints. Protect all write endpoints (POST/PUT/DELETE) while leaving read endpoints open.
Checklist
- Add python-jose[cryptography] or PyJWT dependency
- Create auth dependency that extracts Bearer token from Authorization header
- Verify JWT against Supabase JWT secret
- Create
get_current_userdependency (returns User or None) - Create
require_authdependency (raises 401 if not authenticated) - Apply
require_authto all write endpoints (POST, PUT, DELETE) - Add tests for auth middleware (valid token, expired token, missing token)