Closed AhmedKhDev closed 1 week ago
You may try passing SignOutScope.local
to the auth.signOut()
method to only remove the session locally and not invalidate any other no more existing sessions.
You may try passing
SignOutScope.local
to theauth.signOut()
method to only remove the session locally and not invalidate any other no more existing sessions.
gives the same error
I see now in the code from the signOut method, that the exception should actually be caught. I guess you are using vscode and you have enabled the option to stop on all exceptions in the debugger. Please turn that off and verify that your call to auth.signOut()
actually throws.
It doesn't throw if i turm off to stop on All Exceptions. thank you
Describe the bug I want to implement a feature in my the allows the user to delete his own profile. So i am using an edge function to delete the user with auth.admin.deleteUser but sign out after the delete fails
To Reproduce Steps to reproduce the behavior:
Deno.serve(async (req: Request) => { try { // Create instance of SupabaseClient using JSR import const supabaseAdmin = createClient( Deno.env.get("SUPABASE_URL") ?? "", Deno.env.get("SUPABASE_SERVICE_ROLE_KEY") ?? "", { auth: { autoRefreshToken: false, persistSession: false, }, }, );
} catch (error) { console.error("Error in delete user function:", error); return new Response( JSON.stringify({ error: error instanceof Error ? error.message : "Unknown error occurred", }), { headers: { "Content-Type": "application/json" }, status: 500, }, ); } });
Expected behavior user should be signed out with no errors.
Version (please complete the following information): macOS ├── supabase_flutter 2.8.0 │ ├── supabase 2.5.0 │ │ ├── functions_client 2.4.0 │ │ ├── gotrue 2.10.0 │ │ ├── postgrest 2.3.0 │ │ ├── realtime_client 2.4.0 │ │ ├── storage_client 2.2.0