Skip to content

feat(auth): wire up sign-in and session route guards - #119

Merged
anthonyA1214 merged 1 commit into
mainfrom
feat/auth-sign-in-and-route-guards
Nov 27, 2026
Merged

anthonyA1214 merged 1 commit into
mainfrom
feat/auth-sign-in-and-route-guards

Conversation

@anthonyA1214

Copy link
Copy Markdown
Member

Ticket

N/A

Description

Connects the sign-in form to the allauth backend through react-query-auth, adding zod validation, a loading state, and messages for invalid credentials, pending email verification, and unexpected errors. The root route now loads the session into router context so the authenticated layout redirects guests to sign-in and the unauthenticated layout redirects signed-in users to /. Also re-enables init() and includes a small prop reorder in the machine forms. Registration is not implemented yet, as registerFn is only a stub.

Related Issue

N/A

Type of Change

  • Bug fix
  • New feature
  • Chore
  • Refactor
  • Documentation

Image Change

N/A

- Add auth config in lib/auth.tsx using react-query-auth, with a shared
  user query key and sign-in input schema
- Connect the sign-in form to useLogin with react-hook-form and zod
  validation, error alerts, and a pending state
- Load the session in the root beforeLoad and redirect from the
  authenticated and unauthenticated layouts based on it
- Re-enable init() on app startup
- Reorder input props in the add and update machine forms

Add react-query-auth ^2.4.3 and update bun.lock.
@anthonyA1214
anthonyA1214 merged commit 34af7b9 into main Nov 27, 2026
7 checks passed
@anthonyA1214
anthonyA1214 deleted the feat/auth-sign-in-and-route-guards branch November 27, 2026 04:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant