Open lenzi-e opened 1 month ago
I found a workaround until this is fixed. I tried clearing cookies and didn't have any luck. And (as the issue states) signOut was throwing an error. But if I clear the cookies directly before calling signout, then it works as expected. I'm using react-native / expo and this is how I cleared the cookies:
await AsyncStorage.clear();
await supabase.auth.signOut();
@lenzi-e hmm we fixed this issue in https://github.com/supabase/auth-js/pull/894 but it seems that you are on the version of supabase-js that has the fix so this might be a different issue 🤔
this stems from the browser not knowing that the user has been deleted by the edge function - when the signout method is called from the browser, it's using the access token stored in the browser to make the sign out request but since the user no longer exists, an error is returned.
the expected behaviour is for the client lib to catch this error and just remove the user session from the cookies in the browser
Bug report
Describe the bug
I have an edge function that I invoke via supabas-js which soft deletes a user. This will successfully delete the user. After that I call
auth.signOut()
and get the following error:To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
Soft delete a user. (I used an edge function like this:)
It is successful and returns:
Here is the logs:
Try to logout.
Get the error:
Here is the log:
Expected behavior
I expect the logout, after the user deletion, to work successfully.