This is a rookie mistake. When using the desktop app you are asked for the username and password. Then it removes the password and performs 2-step authentication and asks you to enter code. Then you have to re-enter password.
Coding 101, either retain password when entering auth code, or ask for username, perform 2-step auth and then ask for password.