Nacho Ruiz Martin
05/19/2024, 3:32 PM(Supabase-Auth) No session found
.
On Android, the behaviour is the expected one.
Anyway to debug this?
Thanks!Jan
05/19/2024, 5:00 PMNacho Ruiz Martin
05/19/2024, 5:02 PMNacho Ruiz Martin
05/19/2024, 5:02 PMNacho Ruiz Martin
05/19/2024, 5:26 PM//Class 1 (root app)
init {
supabase.auth.sessionStatus
.onEach {
when(it) {
is SessionStatus.Authenticated -> navigateToPrivateSection()
//...
}
}
}
//Class 2 (login component)
fun onLoginSubmit() {
coroutineScope.launch {
try {
supabase.auth.signinWith(Email) {...}
} catch (e: Exception) {
Logger.e("Error logging in", e)
}
}
}
And the error was that class 2's coroutine was cancelled. So the auth stream emitted before the coroutine finished successfully storing the session in the storage.
Changing the logic to navigate to the private section on class 2 when the coroutine finished did fix it.
Is this expected? I mean, the stream emitting before storing.Nacho Ruiz Martin
05/19/2024, 5:43 PMJan
05/19/2024, 6:32 PMIs this expected? I mean, the stream emitting before storing.Seems like it, but I agree the other way around would make more sense
Nacho Ruiz Martin
05/19/2024, 6:34 PMJan
05/19/2024, 6:37 PMNacho Ruiz Martin
05/19/2024, 6:37 PM