leaderboardsgg / leaderboard-site

Frontend of Leaderboards.gg
https://leaderboards.gg/
GNU General Public License v3.0
55 stars 20 forks source link

Bug: Closing the tab logs you out #590

Closed TheTedder closed 1 week ago

TheTedder commented 4 months ago

Contact Details

No response

What happened?

While logged into the website, upon closing the tab where I was logged in, I was no longer logged in.

What did you expect to happen?

Closing the tab where I am logged into the website and then re-opening it (while keeping the browser open) should not affect my login state.

Step(s) to Reproduce

Open two browser tabs. In one tab, log into the website. Close that tab. Navigate to the website. You are no longer logged in.

Were you on mobile when this happened?

No

What browsers are you seeing the problem on?

Firefox

Other Browser

No response

Relevant log output

No response

erunks commented 4 months ago

Some extra context here for whoever picks this up, the reason why this is happening currently is because we're just storing the current user and their session token in a global nuxt state. If we move this to something like localStorage then this should be resolved. These states are defined in the useCurrentUser and useSessionToken composables.

TheTedder commented 3 weeks ago

I have successfully made the site use cookies to store the current user and session on my branch here but I have somehow broken the tests in the process. Reassigning this task to @buffet-time who volunteered to fix them.