-
-
Notifications
You must be signed in to change notification settings - Fork 412
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: cookies functionality, hyperlinks and shown appropriate content in footer #1079
fix: cookies functionality, hyperlinks and shown appropriate content in footer #1079
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.
Hello @YuvarajSingh-0, thank you for raising a pull request.
Currently, the pull request is marked as https://github.com/MilanCommunity/Milan/labels/%F0%9F%91%B7%F0%9F%8F%BB%E2%80%8D%E2%99%82%EF%B8%8F%20status%3A%20awaiting%20triage which means that work for this issue is on hold and we are waiting for the maintainers/owner to review it and provide you with feedback/suggestions to proceed further.
Feel free to reach out to Tamal on Twitter, or drop a mail at tamalcodes@gmail.com if you think that this pull request is of critical priority.
Give us a ⭐ to show some support
Happy OpenSource 🚀
@tamalCodes Is this good? |
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.
Hi @YuvarajSingh-0 , i don't think you need to change any backend code OR the cookie name. The isLoggedIn
cookie is being set and cleared by the backend itself - there's a logout issue because of the domain
property maybe which I am working on actively.
However, with context to this issue, the isLoggedIn
property is accessible in the code, look at the Navbar for example. Please use that cookie itself without further modifying any server-side code OR cookie name for the same.
Waiting for the changes in the PR !
@tamalCodes You mentioned the backend clears the isLoggedIn cookie but it doesn't which also raises issues with sign in and signup button visibility after logging out, but as you mentioned you are working on it, I am not going to modify anything in backend. Let me modify the code to create new PR |
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.
Please make these minor changes.
Co-authored-by: Tamal Das <tamalcodes@gmail.com>
Co-authored-by: Tamal Das <tamalcodes@gmail.com>
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.
It looks like you have resolved the conflicts in the wrong manner. You overwrote the incoming changes (the changes that I made) with the changes of the current branch (the changes that you had previously).
That is a reason why some UI has also changed. Take a look at this screenshot below.
The left image is the changes that are made by you. The right one is what is currently deployed.
Please fix this.
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.
So, you want the left image to look like the right one.... Right?
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.
Correct. You can check the current code that we have for more reference.
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.
What should I replace in place of 'usertype' cookie? (in line number 28 in HomeBanner.jsx)
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.
I think starting from here it would be the best to keep the changes as it is.
I previously updated the code for the home banner about what to show in the buttons on instances where the user is not logged in, the club is logged in OR the user is logged in. So I think we can maybe ignore the changes for the HomeBanner.jsx
file.
I also see that you have optimized the code for the conditional rendering, thanks for that.
Can you confirm for me if the Login and Logout-based rendering functionality is working perfectly for the footer and stuffs ? IF yes we can merge the same.
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.
Yes, It's Working fine, I've checked it now.
There was also an issue with login trigger while logging in i.e., the login functionality is not hitting the correct backend url for login, I fixed it in ApiEndpoints.js file. And also upon clicking the profile icon after logging in, due to this line the redirecting url does not exist due to no usertype
cookie. But I think that part of code depends on backend, like setting cookie with name usertype
and all.
Apart from these, the footer section is good to merge. But one thing, While logging out, Both cookies isLoggedIn
and Token
should be deleted, failing either one may result in inconsistent results while conditional rendering. Because footer only checks isLoggedIn
cookie, so even if there is no Token
cookie but there is isLoggedIn
cookie, it still considers it as logged in.
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.
The Login and the usertype
works fine when normally logging in. Google authentication won't work just yet - so please stay tuned. You can learn more about that in this issue.
The token
is an HTTP-only cookie - so you won't be able to access the cookie from the front end. So checking for the Token
cookie makes no sense. Currently, we might have some glitch in the backend where the logout function fails to clear the cookies in production - but it should work properly in the local.
This pull request has been deployed to Vercel.
|
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.
Amazing work 🎉
The changes look good to me and will be merged soon.
Do follow Tamal for more Opensource fun projects and don't forget to drop a star so that you get updated about our latest releases (we will tag you and mention your work) and also a shoutout on social media (LinkedIn and Twitter) !
Happy Opensource 🚀.
It's been great contributing this project, I apologise for the delay in resolving this small issue |
closes #1070
👷🏻 Changes made
Corrected cookie names all around code and fixed backend code that fixes this issue.
📸 Screenshots
Before Logging in 👇
![image](https://private-user-images.githubusercontent.com/83658757/270313053-9ba02683-47fc-4178-9a64-dc84ef036c75.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAyNTIyNTMsIm5iZiI6MTcyMDI1MTk1MywicGF0aCI6Ii84MzY1ODc1Ny8yNzAzMTMwNTMtOWJhMDI2ODMtNDdmYy00MTc4LTlhNjQtZGM4NGVmMDM2Yzc1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA2VDA3NDU1M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTg5ZWQyMDIyZDEyYzY1NTVkYTIyMzIyNjU2ZWQ0ZmM0YTY2NGZhZmViNDYzZDAwNGM3MTA1MmFlNGNmODg5NGQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.Wo1FmEBrKtAIFMyiYw3i2ZayN7G0dg9y4WD-IWUbJ6U)
After logging in 👇
![Screenshot 2023-09-25 161216](https://private-user-images.githubusercontent.com/83658757/270316159-5a9dbf19-73c0-4970-afad-05d4097750d5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAyNTIyNTMsIm5iZiI6MTcyMDI1MTk1MywicGF0aCI6Ii84MzY1ODc1Ny8yNzAzMTYxNTktNWE5ZGJmMTktNzNjMC00OTcwLWFmYWQtMDVkNDA5Nzc1MGQ1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA2VDA3NDU1M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQxMDk5OGI5ZWRlNzBhY2QwYTlhNDZjNWM4NTRmNTkxOGUzNmQ1MGIyNDA5NzQzMWFiY2NlZmUzNmRlMGJkNzImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.F3ZfC_QRlfCjNQOUIM4B5XsNHlEzgPwW_rlmOm3JW6Y)