-
-
Notifications
You must be signed in to change notification settings - Fork 98
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
fix: cookie issue fix by separating the cookie logic #266
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThe modifications primarily focus on refining the authentication process by adjusting where and how cookies are set for user authentication details. This initiative aims to resolve an issue where user authentication cookies were being set twice, leading to redundancy. The changes involve shifting the cookie setting logic from redux reducers to specific authentication components (login and register), enhancing the import method for a utility function, and removing redundant cookie-setting operations. Changes
Assessment against linked issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Great job, @Sanchitbajaj02! 🎉 Thank you for submitting your pull request. Your contribution is valuable and we appreciate your efforts to improve our project. Keep being the part of the community!
'We will promptly review your changes and offer feedback. Keep up the excellent work!
Kindly remember to check our Contributing Guidelines'
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.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (5)
- src/components/core/navbar/index.tsx (1 hunks)
- src/components/pages/auth/login/index.tsx (2 hunks)
- src/components/pages/auth/register/index.tsx (2 hunks)
- src/components/pages/auth/verification/index.tsx (1 hunks)
- src/redux/reducers/authReducer.ts (2 hunks)
Additional comments: 8
src/redux/reducers/authReducer.ts (1)
- 1-7: > 📝 NOTE
This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [1-34]
The removal of
setCookie
function calls from thesaveUserToStore
function aligns with best practices by keeping reducers pure and free of side effects. Ensure that the cookie setting logic has been correctly implemented in the respective components to maintain functionality.src/components/pages/auth/verification/index.tsx (2)
- 8-8: The update to the import statement for
useWindowSize
reflects good maintenance practice, likely due to changes in thereact-use
library structure.- 5-11: > 📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [68-74]
Moving the
setCookie
logic into the component is a strategic improvement that directly addresses the issue of cookie duplication. Ensure that the cookies are set correctly based on the response payload and that this change does not introduce any unintended side effects.src/components/core/navbar/index.tsx (1)
- 16-21: > 📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [1-1]
The removal of the unused import
userCollectionDB
from@/types/auth
is a good practice for code cleanliness and efficiency. Ensure that this import was indeed not used within thenavbar
component to prevent any unintended functionality loss.src/components/pages/auth/login/index.tsx (2)
- 18-18: The addition of the
setCookie
import from "nookies" is correctly implemented to facilitate cookie setting within the component.- 68-74: Implementing the logic to set cookies directly in the
login
component is a strategic improvement that addresses the issue of cookie duplication. Ensure that the cookies are set correctly based on the response payload and that this change does not introduce any unintended side effects.src/components/pages/auth/register/index.tsx (2)
- 17-17: The addition of the
setCookie
import from "nookies" is correctly implemented to facilitate cookie setting within the component.- 79-85: Implementing the logic to set cookies directly in the
register
component is a strategic improvement that addresses the issue of cookie duplication. Ensure that the cookies are set correctly based on the response payload and that this change does not introduce any unintended side effects.
Related Issue
Closes #265
Description
cookie setting issue fixed