Implement an auth guard and openapi-ts#22
Merged
Conversation
JortWillemsen
previously approved these changes
Dec 10, 2025
JortWillemsen
previously approved these changes
Dec 10, 2025
There was a problem hiding this comment.
Pull request overview
This PR implements authentication infrastructure for the application by adding session-based authentication with cookie storage, an auth guard middleware to protect routes, and integrates OpenAPI TypeScript client generation for type-safe API calls. It also updates the Docker configuration to properly expose the Vite development server port.
Key changes:
- Implements session-based authentication with login, logout, and registration routes
- Adds
requireAuthmiddleware to protect routes from unauthorized access - Integrates
@hey-api/openapi-tsfor generating type-safe API client code from OpenAPI specifications - Updates frontend port mapping from 3000 to 5173 to match Vite's default development server
Reviewed changes
Copilot reviewed 31 out of 32 changed files in this pull request and generated 17 comments.
Show a summary per file
| File | Description |
|---|---|
| compose.yaml | Updates frontend port mapping to 5173 for Vite dev server |
| Frontend/package.json | Adds openapi-ts dependency and script for API client generation |
| Frontend/openapi-ts.config.ts | Configures OpenAPI code generation targeting local backend |
| Frontend/yarn.lock | Adds dependency lock entries for openapi-ts and related packages |
| Frontend/app/sessions.server.ts | Implements cookie-based session storage for authentication tokens |
| Frontend/app/middleware/auth.ts | Provides auth guard to protect routes requiring authentication |
| Frontend/app/routes/auth/login.tsx | Implements login page with form handling and session management |
| Frontend/app/routes/auth/register.tsx | Implements registration page UI (form handling not yet implemented) |
| Frontend/app/routes/auth/logout.tsx | Implements logout by destroying session and redirecting |
| Frontend/app/routes.ts | Updates routing configuration with auth layout and protected routes |
| Frontend/app/root.tsx | Configures API client with auth token from session and adds response interceptor |
| Frontend/app/layout/auth.tsx | Provides layout wrapper for authentication pages |
| Frontend/app/routes/home.tsx | Updates home page to be protected and demonstrate API calls |
| Frontend/app/util/date.util.ts | Adds utility for formatting dates in various formats |
| Frontend/app/api/* | Auto-generated TypeScript API client code from OpenAPI spec |
| .gitattributes | Marks auto-generated API files as linguist-generated |
| .devcontainer/devcontainer.json | Updates port forwarding and labels for new frontend port |
Comments suppressed due to low confidence (1)
Frontend/app/routes/auth/login.tsx:32
- This guard always evaluates to false.
if (userId == null) {
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Author
|
ugh Copilot. Die stond kennelijk nog aan in mijn instellingen |
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.
No description provided.