This pull request introduces several key updates to the authentication flow, including the handling of authentication tokens, improved validation during the signup process, and enhanced error handling. These changes aim to improve the security and user experience of the login, logout, profile, and signup functionalities within the application.
Summary
Added token storage in localStorage upon successful login in src/app/login/page.tsx, enhancing session management.
Implemented token removal from localStorage during logout in src/app/profile/page.tsx to ensure user sessions are properly terminated.
Updated the getUserDetails function in src/app/profile/page.tsx to include an Authorization header with the stored token, improving security for profile data requests.
Enhanced error handling in getUserDetails to provide user feedback in case of failure to fetch user details.
Added email format validation and password length validation in src/app/signup/page.tsx, improving the robustness of the signup process.
Switched from using fetch to axios for the signup request in src/app/signup/page.tsx, aligning with the rest of the application's API request strategy and handling cookies more effectively with withCredentials: true.
Upon successful signup, the user's token is now stored in localStorage and the user is redirected to the login page, streamlining the user flow from signup to login.
These changes collectively enhance the application's authentication mechanisms, making them more secure, user-friendly, and consistent across different components.
Fixes #13.
π Latest improvements to Sweep:
New dashboard launched for real-time tracking of Sweep issues, covering all stages from search to coding.
Integration of OpenAI's latest Assistant API for more efficient and reliable code planning and editing, improving speed by 3x.
PR Feedback (click)
Description
This pull request introduces several key updates to the authentication flow, including the handling of authentication tokens, improved validation during the signup process, and enhanced error handling. These changes aim to improve the security and user experience of the login, logout, profile, and signup functionalities within the application.
Summary
localStorage
upon successful login insrc/app/login/page.tsx
, enhancing session management.localStorage
during logout insrc/app/profile/page.tsx
to ensure user sessions are properly terminated.getUserDetails
function insrc/app/profile/page.tsx
to include anAuthorization
header with the stored token, improving security for profile data requests.getUserDetails
to provide user feedback in case of failure to fetch user details.src/app/signup/page.tsx
, improving the robustness of the signup process.fetch
toaxios
for the signup request insrc/app/signup/page.tsx
, aligning with the rest of the application's API request strategy and handling cookies more effectively withwithCredentials: true
.localStorage
and the user is redirected to the login page, streamlining the user flow from signup to login.These changes collectively enhance the application's authentication mechanisms, making them more secure, user-friendly, and consistent across different components.
Fixes #13.
π Latest improvements to Sweep:
π‘ To get Sweep to edit this pull request, you can:
This is an automated message generated by Sweep AI.