auth.onAuthStateChange()
Receive a notification every time an auth event happens.
final subscription = supabase.auth.onAuthStateChange((event, session) {
print(session?.user?.id);
// handle auth state change
});
Examples
Listen to auth changes
final subscription = supabase.auth.onAuthStateChange((event, session) {
print(session?.user?.id);
// handle auth state change
});