SELECT 1 FROM trip_members WHERE trip_id = check_trip_id AND user_id = auth.uid() AND role IN ('owner', 'editor') DROP POLICY IF EXISTS "Users can view trips they collaborate on" ON public.trips; DROP ...
-- user_profiles again, triggering the same policies → infinite recursion. -- Fix: replace user_profiles policies with JWT app_metadata checks (no table lookup ...