Build login page #24

Open
opened 2026-03-16 22:44:10 +00:00 by austin · 0 comments
Owner

The entry point for unauthenticated users. Handles local auth login.

What needs to happen

  • Create a login page at /login with email and password fields
  • On submit, POST /auth/login
  • On success, redirect to /
  • On error, display the error message inline
  • Add a "Don't have an account? Register" link to /register

Auth state management:

  • Create a React context/provider for auth state
  • On app load, call GET /api/me to check if the user is authenticated
  • Store current user info (name, email) in context
  • Add a route guard component that redirects unauthenticated users to /login

Key files

  • web/src/pages/Login.tsx — new
  • web/src/hooks/useAuth.ts or web/src/lib/auth-context.tsx — new
  • web/src/App.tsx — wrap routes with auth provider
The entry point for unauthenticated users. Handles local auth login. ## What needs to happen - Create a login page at `/login` with email and password fields - On submit, `POST /auth/login` - On success, redirect to `/` - On error, display the error message inline - Add a "Don't have an account? Register" link to `/register` **Auth state management:** - Create a React context/provider for auth state - On app load, call `GET /api/me` to check if the user is authenticated - Store current user info (name, email) in context - Add a route guard component that redirects unauthenticated users to `/login` ## Key files - `web/src/pages/Login.tsx` — new - `web/src/hooks/useAuth.ts` or `web/src/lib/auth-context.tsx` — new - `web/src/App.tsx` — wrap routes with auth provider
austin self-assigned this 2026-03-16 22:44:10 +00:00
Sign in to join this conversation.
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Blocks Depends on
Reference
austin/vektor#24
No description provided.