-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor and Optimize AuthProvider in Frontend
- Streamlined state management in AuthProvider by consolidating the use of `useState` and `useCookies` for a single source of truth. - Simplified state updates in `executeAuthAction` to reduce unnecessary re-renders. Considered the use of a reducer for grouped state management. - Enhanced Axios interceptor setup in `useEffect` for better handling of authorization headers, including cleanup logic to prevent memory leaks. - Optimized `resetLogoutTimer` and `logout` functions to reduce complexity and dependency recalculations. - Eliminated redundant `loginStatus` state, relying on individual states like `isLoggedIn`, `authUser`, etc. - Adjusted `useEffect` hooks to respond only to relevant changes in cookies, preventing unnecessary updates. - Updated `useEffect` dependency arrays to include only necessary dependencies and improve performance. - Removed the debugging `useEffect` in preparation for production deployment. These changes aim to enhance the performance, readability, and maintainability of the frontend authentication logic, ensuring a more efficient and reliable user authentication experience.
- Loading branch information
Showing
92 changed files
with
4,534 additions
and
2,822 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{ | ||
} |
This file contains 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
Oops, something went wrong.