This happened to me also. I somehow found it that my two factor authentication had been turned on.
Disabling Two-Factor Authentication on Apple ID
1.Open any web browser on any computer and go to icloud.com or appleid.apple.com
2.Log in to the Apple ID you want to disable two factor authentication for, you may need to use two factor auth to gain access to the account
3.Go to the “Security” section of account settings and choose “Edit”
4.Locate the “Two-Factor Authentication” section where it says the feature is ON, and click the link to “Turn Off Two-Factor Authentication”
5.Create new security questions to assign to the Apple ID, these are used in place of two-factor auth codes
6.When finished disabling two-factor auth you can log out of the Apple ID management website
Once two-factor authentication is disabled, you can log in to Apple ID from anywhere, whether on the web, iOS, iPhone, iPad, Mac, anywhere, with only a password again, you won’t need to double authenticate with a trusted device code.
Whether or not to use two-factor authentication is largely a matter of personal preference, there is no right or wrong answer here. Remember, you can always turn on two-factor auth for Apple ID again if you decide to use the service again at a later date. Either way, be sure to use a strong password.