Skip to content
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

user in inbox not changing on first render #39

Closed
joshxfi opened this issue Jul 23, 2022 · 2 comments
Closed

user in inbox not changing on first render #39

joshxfi opened this issue Jul 23, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@joshxfi
Copy link
Member

joshxfi commented Jul 23, 2022

Describe the bug
Account/user's inbox does not change after signing out and then logging in with a different account but only changes after a reload.

To Reproduce
Steps to reproduce the behavior:

  1. Login
  2. Logout
  3. Login with a different account
  4. You'll see that the user in the unique link was from the one you previously logged in

Expected behavior
The user in the inbox should be the one that is currently logged in on first render

Screenshots

  • logged in as test but previously logged in as testuser.
    image
@joshxfi joshxfi added the bug Something isn't working label Jul 23, 2022
@princejoogie
Copy link
Member

this is caused by the getServerSideProps. it only runs on page load. I think i previously had this working with no ssr. to fix this, you should use useSession which keeps track of the current user. the id of the user is accessible there. theres also a status in useSession that you will use to redirect to login

we can get rid of getserversideprops entirely

@joshxfi
Copy link
Member Author

joshxfi commented Jul 23, 2022

I see, I'll work on a fix, thanks!

EDIT:
fix: 3e453d4

@joshxfi joshxfi closed this as completed Jul 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants