Taken directly from the two-factor authentication page:
“If you're signing in and don’t have a trusted device handy that can display verification codes, you can have a code sent to your trusted phone number via text message...”
I have 2FA enabled and a trusted phone number for my account. I was able to receive a text message with the exact wording the OP has stated. I did, however, receive notifications on all my devices to allow or deny access to my account from the location I was trying to log in from. On the device I was trying to sign in, there is a link that says “Didn’t get a verification code?” which gave the option to send the code via text. It is possible that the notification to allow or deny was dismissed without really being paid attention to or didn’t go through due to lack of internet connectivity and the person attempting to sign in had the code sent via text.