© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•14mo ago•
4 replies
Gus

having trouble allowing users to delete their account from client

Hey friends,

Trying to allow users to delete their own account in my iOS app. I created a RPC with security definer that runs delete from auth.users where id = auth.uid();

The issue I'm having is the user isn't signed out when that's called. I tried explicitly calling auth.signOut afterwards, however that throws an error since the user no longer exists. If I call auth.signOut before calling the delete, then the delete doesn't work since the user is no longer signed in.

Anyone have any advice on how I can both delete & logout? Is there a method to nullify or expire the JWT or something?

Thanks!
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Allowing users to view their own data
SupabaseSSupabase / help-and-questions
4y ago
Can't delete users from dashboard
SupabaseSSupabase / help-and-questions
7mo ago
Can't delete users from Authentication tab
SupabaseSSupabase / help-and-questions
8mo ago
Having trouble accessing database from edge funtion.
SupabaseSSupabase / help-and-questions
14mo ago