Skip to content

Commit 7b1f7cf

Browse files
committed
fix: keep auth token valid while in background when using realtime
1 parent 7749b98 commit 7b1f7cf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/supabase_flutter/lib/src/supabase_auth.dart

+3-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,9 @@ class SupabaseAuth with WidgetsBindingObserver {
119119
case AppLifecycleState.detached:
120120
case AppLifecycleState.inactive:
121121
case AppLifecycleState.paused:
122-
Supabase.instance.client.auth.stopAutoRefresh();
122+
if (Supabase.instance.client.realtime.getChannels().isEmpty) {
123+
Supabase.instance.client.auth.stopAutoRefresh();
124+
}
123125
default:
124126
}
125127
}

0 commit comments

Comments
 (0)