Can't sign into App Store on Mac
Macbook pro 13" Early 2011; Processor 2.7 GHz Intel Core i7; Memory 4 GB 1333 MHz DDR3
OS Version OS X 10.9.5 (13F1911); Safari Version 9.1.3 (9537.86.7.8); App Store Version 1.3 (201.7); iTunes Version 12.6.1.26
Tried to upgrade to latest version of my OS, but it failed. The App Store shown that OS can be upgraded free. Once free upgrade button clicked, show up the sign up form. Filled the apple ID and password correctly same as on my iPhone however system gave replies "An Apple ID verification code is required to sign in. Type your password followed by the verification code shown on your other devices." and my iPhone received a messages "Apple ID sign In Requested [My_email] Your Apple Id is being used to sign in to a device near [My_location]". Then once clicked allow bottom, show a message " Apple ID Verification Code Type your password followed by this code into the password field on your device"
On the Mac App Store there have not a place to fill the code number. When I tried clicked sign in again the system sent back that I forget my password.
Have tried many clues from this form such as:
1. Check and set the time and date on my Mac correctly
2. Tried login using my Apple ID on browser safari, Chrome, and Mozilla. It works.
3. At iCloud the Apple ID had been signed in, then signed out. When tried to sign in back, the system sent a verification code to iPhone. However on Mac iCould there have no place to type the verification code. So Can't sign in to the iCloud too.
4. Changed the password but it's same can't sing into App Store and iCloud.
Do someone there can help me to fix this issue?
Thanks
MacBook Pro (13-inch Early 2011)