-
-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need proper signOut() after deleting account #404
Comments
Hi @262hz, I couldn't reproduce it with the latest version, can you test with the latest 2.11.0 version? We even have an integration test for asserting exactly this case, https://github.com/supabase/supabase-swift/blob/main/Tests/IntegrationTests/AuthClientIntegrationTests.swift#L196 So, please test with the latest library version, and let me know if you have any issues. |
@grdsdev You're right — it's not an issue with 2.12.0 (the latest version) Thanks for following up |
Bug report
Describe the bug
Need to be able to properly sign out after deleting account. Apple requires account deletion functionality for iOS apps, and I've implemented that... it was a bit of a hassle — I needed to create a function in the SQL editor because the Supabase SDK for iOS does not include an easy way to delete an account. But the biggest issue is that I need to automatically sign out the user after the account is deleted. Calling
supabase.auth.signOut()
is not sufficient — it fails to callsessionManager.remove()
and the result is that the app still considers the session to be active. I can't directly callsupabase.auth.sessionManager.remove()
becausesessionManager
is private. As a hack solution, I'm callingsupabase.auth.signInWithOTP()
because that function callssessionManager.remove()
. Here's the full "hack solution" for reference:To Reproduce
For reference, this is the
delete_user
SQL function:auth.session != nil
evaluate totrue
Expected behavior
Checks for
auth.session != nil
should evaluate tofalse
aftersignOut()
has been called. After callingsupabase.auth.signOut()
, the SDK needs to callsupabase.auth.sessionManager.remove()
in order to end the session.System information
Additional context
Here's what I'm currently doing as a "hack solution":
The text was updated successfully, but these errors were encountered: