Hi, I recently switched to the PKCE auth flow, and I'm implementing a password reset screen. However, the
supabase.auth.parseSessionFromUrl()
supabase.auth.parseSessionFromUrl()
function throws a
java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
error and I have no clue why.
Logcat:
B1: https://myapp.com/callback?code=55793db3-8770-8980-81ee-9477db9c3f04Deep link handling exception: java.lang.IllegalArgumentException: No access token found
B1: https://myapp.com/callback?code=55793db3-8770-8980-81ee-9477db9c3f04Deep link handling exception: java.lang.IllegalArgumentException: No access token found
Code:
fun handleDeepLink(url: String) { screenModelScope.launch { try { log.error { "B1: $url" } val session = supabaseClient.auth.parseSessionFromUrl(url) log.error { "B2" } supabaseClient.auth.importSession(session) } catch (e: Exception) { log.error { "Deep link handling exception: $e" } snackbarManager.sendMessage("Failed to open link: ${e.message}") } } }
fun handleDeepLink(url: String) { screenModelScope.launch { try { log.error { "B1: $url" } val session = supabaseClient.auth.parseSessionFromUrl(url) log.error { "B2" } supabaseClient.auth.importSession(session) } catch (e: Exception) { log.error { "Deep link handling exception: $e" } snackbarManager.sendMessage("Failed to open link: ${e.message}") } } }
However, when I switch to implicit flow, it suddenly works. (The URL is also different). Is there anyone who knows how can I make it work with PKCE?
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.