-
Notifications
You must be signed in to change notification settings - Fork 0
auth integration and also making sign in and signup nav bar buttons work #44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR integrates frontend authentication functionality by connecting existing auth service functions to login/signup forms and implementing session-based navigation. The changes enable end-to-end user authentication with proper error handling and loading states.
- Connected login and signup forms to backend auth service with error handling and loading states
- Updated navbar to display different options based on authentication status (Profile/Logout vs Sign In/Sign Up)
- Enhanced profile page to show session information and authentication-aware content
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| client/src/types/dto/accountDto.ts | Added SignupInput type for extended signup data |
| client/src/services/authService.ts | Fixed API endpoints and updated signup function parameter type |
| client/src/lib/authClient.ts | Updated base URL configuration with fallback |
| client/src/components/Navbar.tsx | Added dynamic navigation based on auth status with logout functionality |
| client/src/app/signup/page.tsx | Connected signup form to auth service with error handling and loading states |
| client/src/app/profile/page.tsx | Made profile page authentication-aware with session display |
| client/src/app/login/page.tsx | Connected login form to auth service with error handling and loading states |
| client/src/app/api/auth/[...nextauth]/route.ts | Fixed API endpoint paths for NextAuth configuration |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| password: values.password, | ||
| }; | ||
|
|
||
| await signup(signupData, "/profile"); |
Copilot
AI
Sep 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The signup function is called with a hardcoded redirect URL '/profile'. Consider making this configurable or using a constant to improve maintainability and flexibility.
| password: values.password, | ||
| }; | ||
|
|
||
| await login(loginData, "/profile"); |
Copilot
AI
Sep 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The login function is called with a hardcoded redirect URL '/profile'. Consider making this configurable or using a constant to improve maintainability and consistency with other parts of the application.
naasanov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fuck yeah I love you
Integrate Frontend Auth Service with Login and Signup Pages
Integrated the existing auth service with login and signup forms to enable end-to-end authentication. Added proper error handling, loading states, and session management.
Changes
Users can now sign up/login through the forms, which calls the backend API to generate JWT tokens. Refresh tokens are stored in httpOnly cookies, access tokens are available via NextAuth session, and automatic token refresh is handled. Logout clears session and redirects appropriately.
Closes #12