If you are using 2 factor authentication on an older device…
You should be able to append the code to your password and enter that (i.e. if your password is ABC and your code is 123, enter ABC123), however if this doesn't work it may be that you are running out of time using your authentication code and you may want to delay getting your code until the last minute or temporarily disable the 2 step verification/2 factor authentication, although it shouldn’t be necessary.
Get a verification code and sign in with two-factor authentication