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

Auth magic.link cached token should be purged after logout #2861

Closed
LBrian opened this issue Jun 20, 2021 · 0 comments · Fixed by #2862
Closed

Auth magic.link cached token should be purged after logout #2861

LBrian opened this issue Jun 20, 2021 · 0 comments · Fixed by #2862
Labels
bug/confirmed We have confirmed this is a bug topic/auth

Comments

@LBrian
Copy link
Contributor

LBrian commented Jun 20, 2021

[Context]
authentication, magic.link

[Root cause]
I believe this a side effect from #2555 to cache token for 10 mins.

[Reproduce]
Log in user A and log out then log in user B right after, getCurrentUser returns user A metadata instead since user A's token is cached, reload the page fix this issue.

[Solution]
Purge cached token in logout function

logout: async () => {
  token = null
  expireTime = 0
  await client.user.logout()
},
@thedavidprice thedavidprice linked a pull request Jun 21, 2021 that will close this issue
@thedavidprice thedavidprice added bug/confirmed We have confirmed this is a bug topic/auth labels Jun 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/confirmed We have confirmed this is a bug topic/auth
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants