Repository navigation
feat(auth): wire up sign-in and session route guards - #119
Merged
Merged
Conversation
- 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-enablesinit()and includes a small prop reorder in the machine forms. Registration is not implemented yet, asregisterFnis only a stub.Related Issue
N/A
Type of Change
Image Change
N/A