As announced for iOS 17 and macOS Sonoma, “One-time verification codes you receive in Mail are filled in automatically, so you can log in without leaving Safari.”
Is there any documentation about this? Maybe for a specific keyword that must be in the HTML email body? I tried it on my website with a verification code sent by email and it didn't work.