This repository was archived by the owner on Oct 10, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 195
This repository was archived by the owner on Oct 10, 2025. It is now read-only.
signIn / signOut not working properly #345
Copy link
Copy link
Closed
Labels
Description
Bug report
Describe the bug
Hi! I think signOut method is not properly destroying the session until the page is refreshed.
To Reproduce
- Sign in
- Get data from database related to user
- Sign out
- Sign in again with another user
- Try to get user-related data from db again
I'm using this code to test:
// Login
setTimeout(
async () => console.log( await this.$supa.auth.signIn( { email: 'user111@test.com', password: 'foo123' } ) ),
1000
);
// Profile
setTimeout(
async () => console.log( await this.$supa.from( 'profiles' ).select().single() ),
2000
);
// Logout
setTimeout(
async () => console.log( await this.$supa.auth.signOut() ),
3000
);
// Login again
setTimeout(
async () => console.log( await this.$supa.auth.signIn( { email: 'user222@test.com', password: 'bar123' } ) ),
4000
);
// Profile
setTimeout(
async () => console.log( await this.$supa.from( 'profiles' ).select().single() ),
5000
);
The problem is that both select profile requests always returns the same profile.
- If I logged In with user1 first, then both profiles will be from user1.
- If I change the code, switching the signIn order (user2 before), then both profiles will be from user2 now.
Expected behavior
To each select get only the profile of the authenticated user.
Screenshots
Now switching the signIn credentials:

System information
- OS: Arch Linux 5.15.29-1-lts x64
- Firefox 98.0.1
- Version of supabase-js: v1.31.2
- Version of Node.js: v16.14.2

