Access iCloud on my Mac without my phone?

I left my phone at home, I'm on my Mac. I go to icloud.com. It tells me to enter the code sent to my devices. Normally a code pops up on my Mac but it's not this time.

How do I access icloud on my mac without my phone?


Solution 1:

System preferences → iCloud → account details → security → get a verification code: for Mojave

System Preferences → Apple ID → Password & Security → Get a verification code: for Catalina