-
-
Notifications
You must be signed in to change notification settings - Fork 65
Open
Labels
questionFurther information is requestedFurther information is requested
Description
General info
- I checked the troubleshooting page for similar problems
What is your question?
Problem
I'm experiencing frequent JWT expiration issues in my Android application that primarily runs in the background. Despite configuring alwaysAutoRefresh = true
, and enableLifecycleCallbacks = false
, sessions aren't consistently refreshed when the app is in background state.
Configuration
I'm using Supabase version 3.1.4 with Kotlin. Here's my client configuration:
val client by lazy {
createSupabaseClient(
supabaseUrl = SUPABASE_URL,
supabaseKey = SUPABASE_KEY
) {
defaultSerializer = KotlinXSerializer(json)
install(Postgrest)
install(Realtime)
install(Auth) {
alwaysAutoRefresh = true
enableLifecycleCallbacks = false
}
install(Functions)
}
}
Questions
- Is there a recommended approach for handling token refreshing in Android apps that spend significant time in background state?
- Are there specific configuration options I'm missing to make the built-in refresh mechanism work properly in background?
Relevant log output (optional)
Error updating request status | Error: io.github.jan.supabase.postgrest.exception.PostgrestRestException: JWT expired
URL: https://XXXX.supabase.co/rest/v1/device_health_commands?id=eq.XXXX-XXXX&select=%2A
Headers: [Authorization=[Bearer XXXXXXXXXXXX], Prefer=[return=representation], Content-Profile=[public], apikey=[XXXXXXXXXXXX], X-Client-Info=[supabase-kt/3.1.4], Accept=[application/json], Accept-Charset=[UTF-8]]
Http Method: PATCH
marioortizmanero
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested