My KMP app is offline first, so what is the best w...
# supabase-kt
t
My KMP app is offline first, so what is the best way to handle supabase session ? • How to ensure that the session refreshes ? • If the session is lost, is there a way to refresh it without asking the user to log in again ? I didn't find resources on the subject, maybe there are ? Thanks :)
j
The session is handled automatically and if there is no network connection it will retry until it succeeds. The session cannot be lost it is not deleted on network errors
t
Well, I was in a case where the current session was null 🤕 Is there a method to call so that the session is handled ? Or is it done when the Auth plugin is configured ?
j
It should be done automatically. You could look at debug logs to check why the session was deleted
t
Ok thanks, not sure when or how it happened. If I encounter the problem again, I will look more carefully at logs ! Thanks !
Could it be that the phone was offline for too long and the session couldn't be refreshed ? Is there a timeout on this ?
j
The refresh tokens don't expire so I'm not sure
c
IIRC (it was a longgg time ago) but if you enable logging there are some really helpful logs about that state of auth and why. (unless I was logging that myself?) but i remember it helped me get a good grasp on what supabase was doing
j
yea the default log level is INFO, DEBUG logs pretty much log everything but has to be set manually
1