[BUG] Login of the user doesn't stay if I refresh the page ( Non - consistent )
Is there an existing issue for this?
- [X] I have searched the existing issues
Current Behavior
When I login and then refresh the page, it immediately shows me that I am logged out and asks me to login in again, where as according to the logic it should have waited for 4mins and only after 4mins it should have showed me to login again
Expected Behavior
Until it has hit four minutes I shouldn't be logged out after refresh
Reproduction steps
1. Go to https://wanderlust-beta.vercel.app/
2. Register/Login
3. See the create-post and logout button
4. Refresh the page.
5. You'll again see the login button
Screenshots
Login and after Refresh
Logs
No response
Browsers
No response
OS
No response
cc: @0xmohitsen
@Janith-Chamikara can you kindly look into this...
the cookie is not set in the cookie section when we logged in the website and i am currently working on it sir. @krishnaacharyaa
Sure Sir @Ameerjafar
hello sir I need your help. can you check whether token set in the cookie section or not please let me know. @krishnaacharyaa
Hi @Ameerjafar please try figuring out, and ask in the team's discord for help, if it doesn't work at all, worst case. We can sync up.
p.s: You can find it in the console of the web browser in the application section there you'll have cookies section... Kindly check there
@krishnaacharyaa I found the exact error sir. whenever we are refreshing the page the home page(header-layout) component will re-render if it is re-render the usestate is set to null because it is not persistent when the page is refresh even it is static.
@Ameerjafar Thats a great insight, precisely it is because we are storing the token in the state, instead we should store it in the cookies, and revalidate cookies everytime, if in state, it loses persistence
can i make pr for this i solved this issue sir @krishnaacharyaa
Yes please @Ameerjafar , please make sure you followed all the contributing guidelines https://github.com/krishnaacharyaa/wanderlust/blob/9b11b769bb23150b746296cf9008056633d21921/.github/CONTRIBUTING.md#guidelines-for-contributions
Hi there! I'm excited to contribute to this project and would love to work on this issue. Could you please assign it to me? Thanks!
@thefarhanahmad i have completed this issue just I need to make the pr according to the guidelines has given.
@thefarhanahmad i have completed this issue just I need to make the pr according to the guidelines has given.
Yes, follow the guidelines.
I have made the pr can you check that sir @krishnaacharyaa
Ok, I will check.
On Fri, May 10, 2024 at 7:59 PM Ameer jafar @.***> wrote:
I have made the pr can you check that sir @krishnaacharyaa https://github.com/krishnaacharyaa
— Reply to this email directly, view it on GitHub https://github.com/krishnaacharyaa/wanderlust/issues/172#issuecomment-2104711512, or unsubscribe https://github.com/notifications/unsubscribe-auth/A25A7WKBQRFZ6RHD6VS63JLZBTKS3AVCNFSM6AAAAABHHPWSLKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBUG4YTCNJRGI . You are receiving this because you were mentioned.Message ID: @.***>
@krishnaacharyaa can i make pr now according to the guildlines you have provided sir.
Sure @Ameerjafar , But I see we are still not very sure on what is the root cause , and how to gracefully handle it from ground up, let's come to a root cause and approach and then raise PR based on the guidelines. That would be much better in my opinion and both of our time would be saved :)
@krishnaacharyaa i have raised the pr for this error sir.
@Ameerjafar reviewed it :)