X/auth page#54
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR implements authentication functionality for a CRM frontend application, adding login and signup pages with server actions and backend auth endpoints.
- Creates comprehensive authentication flow with login/signup pages and form validation
- Implements server actions for handling authentication with proper error handling and redirects
- Updates user schemas and controllers to support new authentication requirements
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/middleware.ts | Adds blank line for code formatting |
| src/lib/schemas/user.schema.ts | Updates user schema to support login/signup with new password field and validation |
| src/lib/controllers/user.controller.ts | Modifies user creation to properly map password field to hashedPassword |
| src/lib/auth/auth-service.ts | Implements signup and loginAction server functions with form validation |
| src/lib/auth/auth-client.tsx | Creates placeholder file for future React context implementation |
| src/app/layout.tsx | Updates app metadata with proper title and description |
| src/app/globals.css | Implements custom styling with Inter font and Sarge brand colors |
| src/app/(web)/dashboard/page.tsx | Removes old dashboard implementation |
| src/app/(web)/(user)/dashboard/page.tsx | Creates new authenticated dashboard showing user name |
| src/app/(web)/(auth)/signup/page.tsx | Implements complete signup form with validation and error handling |
| src/app/(web)/(auth)/login/page.tsx | Implements complete login form with validation and error handling |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| data: { | ||
| name: validatedUser.name, | ||
| email: validatedUser.email, | ||
| hashedPassword: validatedUser.password, | ||
| }, |
There was a problem hiding this comment.
The password is being stored directly as hashedPassword without hashing. This should hash the password using bcrypt before storing it in the database.
| if (state && !state.success && Object.keys(state.errors).length === 0 && state.message) { | ||
| alert(state.message); | ||
| } |
There was a problem hiding this comment.
Using alert() for error messages provides poor user experience. Consider using a toast notification or inline error display instead.
bderbs30
left a comment
There was a problem hiding this comment.
lgtm (lets get this moon) gru approved
4766c23 to
c55a48d
Compare
[CRM Frontend] - Auth pages
Changes
Creates a login and signup page along with server actions to handle these functions. Adds endpoints for auth to the backend
Notes
Does not include text for resetting password.
Screenshots
Place screenshots here
Checklist
Please go through all items before requesting reviewers:
Closes
Closes #