MacOS – Not receiving verification code while trying to sign into iCloud and Apple Store

apple-idicloudmacosupgrade

Decided to reset the Macbook. Got MacOS 10.8.5 installed. Trying to update to Mojave (10.14.6) from the link here – https://support.apple.com/HT211683, as upgrading directly to latest not supported for this version.

Apple Store pops open and clicking Get asks for logging into Apple Store through iCloud account, which was skipped during upgrade time. Signing in gave this error:
"Apple ID Verification Code Required: type your password followed by the verification code shown on your other devices."
There was no code received and there was no other device. What are some options at this point?

Best Answer

Was able to sign into iCloud on the mac using Google Chrome, but not Safari. Was not able to click Account Settings or anything else. The difference here was that was able to use text verification code as other option for 2 factor authentication, and same with below.

Was able to sign into iCloud on Android Chrome, then going into Account Settings led to signing into Apple ID website. From there, going to list of devices, the same mac with the previous OS was listed! Decided to remove this, this was the main issue, and restart the mac. After waiting for a couple of minutes, was able to start receiving auth codes through text.

The first time you enter password and get error message asking for code to be entered. You have to wait a bit, get the code, and try signing in again with format: yourpasswordcode, no space or other character in between. Then, upgrade proceeds.