supabase-community / supabase-kt

A Kotlin Multiplatform Client for Supabase.
https://supabase.com/docs/reference/kotlin/introduction
MIT License
328 stars 33 forks source link

[Bug]: After deleting a user via edge function you can not logout #631

Closed appcelerate closed 2 days ago

appcelerate commented 4 days ago

General Info

Version(s)

2.5.0

Kotlin Target(s) and their respective versions

Android 14

What happened? (include your code)

I have an issue with logging out a user I was deleting.

So the use case is: A user want to delete the account and after deletion the user gets logged out.

Problem: If you call the edge function, user is getting deleted correctly but after this I try to logout and get this error message using the logout function "User from sub claim in JWT does not exist"

iOS SDK had similar issue -> https://github.com/supabase/supabase-swift/issues/358

Steps To Reproduce (optional)

No response

Relevant log output (optional)

No response

grdsdev commented 4 days ago

Hey @jan-tennert,

When signing out, it needs to ignore, 401, 403 and 404 status codes, check Swift implementation: https://github.com/supabase/supabase-swift/blob/083c6c3462a4a8d8eebe5712742bd426e52a1cb6/Sources/Auth/AuthClient.swift#L794-L801

jan-tennert commented 3 days ago

Hi, thanks for reporting this and @grdsdev for the fix. I'll publish a version later resolving this problem.

appcelerate commented 1 day ago

@jan-tennert when can we expect the 2.5.1 release including this fix?

jan-tennert commented 1 day ago

The version should have been out already (on maven central), but it seems like sonatype causes problems again. Will look into it

appcelerate commented 1 day ago

yeah somehow when I try to update it with

implementation(platform("io.github.jan-tennert.supabase:bom:2.5.1"))
implementation("io.github.jan-tennert.supabase:postgrest-kt")
implementation("io.github.jan-tennert.supabase:apollo-graphql")
implementation("io.github.jan-tennert.supabase:compose-auth")
implementation("io.github.jan-tennert.supabase:compose-auth-ui")
implementation("io.github.jan-tennert.supabase:functions-kt")
implementation("io.ktor:ktor-client-android:2.3.8")

its not working

jan-tennert commented 23 hours ago

It seems like Sonatype changed some stuff regarding authentication, which required a few changes on our end, but it should work now. Hopefully, the version will appear in ~30min on Maven Central