Even if someone gets ahold of your username and password, they still can’t log in to your account without the code. When you log in to an online account with two-factor authentication enabled, the site first asks for your username and password, and then, in a second step, it typically asks for a code.