Updating & refreshing user metadata causes Error "Invalid Refresh Token: Already Used" #805
Closed
2 tasks done
Labels
bug
Something isn't working
Bug report
Describe the bug
I'm trying to use the Supabase user metadata as a means of storing user metadata (like preferences eg. is_subscribed_to_newsletter), since it seems way more intuitive than having a clone of it in Postgres, and updating those... This is my code:
Basically, the first time I update any user metadata, it works perfectly, but the second time and all times after that I get the error "Invalid Refresh Token: Already Used"
As seen here and here, other people are also facing this issue.
To Reproduce
updateUser
, thenrefreshSession
updateUser
, thenrefreshSession
again, and you will get error "Invalid Refresh Token: Already Used"Expected behavior
I expect the
refreshSession
to also refetch a new refresh-token, while refetching updated account information for theuseUser
hook.Being able to use the
user_metadata
field for small personal user preferences is super good for DX. I always cringed at the idea of creating some Postgres triggers (that last I checked weren't even production ready) only to create a matchingpublic.users
table that then contained the users data, when we could just use theuser_metadata
itself.System information
The text was updated successfully, but these errors were encountered: