https://www.usatoday.com/story/travel/airline-news/2019/08/1...
Some flights from Europe to US do this at the gate -- there's no opt-out. I remember flying AA from AMS and everybody had to get scanned before boarding (CBP agents were present).