Closed SebasScript closed 4 months ago
+1
In local development, I manually deleted/reset the database while still logged in, and thereafter could not log out using supabase.auth.signOut in the client.
It returned 403 forbidden every time.
Eventually, I cleared the session from LocalStorage in the browser.
I too seem to be hitting this, feels like a recent change that caused it
As a work around deleting the cookies for the site will logout the user
default function deleteAllCookies() {
var cookies = document.cookie; // Get all cookies as a single string
var allCookies = cookies.split(";"); // Split into individual cookies
for (var i = 0; i < allCookies.length; i++) {
var cookie = allCookies[i];
var eqPos = cookie.indexOf("="); // Find the first '='
var name = eqPos > -1 ? cookie.substring(0, eqPos) : cookie; // Extract the cookie name
document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/"; // Set cookie to expire in the past
}
}
this is going to remove all cookies for the site by setting their expiry date into the past. This simply removes all cookies. One could also remove specifically the Supabase cookies. Can call this after deleting the user instead of the supabase.tuh.signOut().
i am a admin account and i want delete a user from auth with supabase.auth.admin.deleteUser(id) and i can, but every account delete i am redirect to login
Bug report
here is a linked discussion delete user RPC causes subsequent signOut request to fail
Describe the bug
If a user deletes their acccount using the javascript sdk, and the frontend calls supabase.auth.signOut() right after delete the account. The signOut will fail and the local cookie wont be deleted.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
on the frontend now call
this will throw the following error
Expected behavior
user should be signed out and cookies / local session removed
System information