Two factor authentication in a single form

We are working on implementing a Google two factor authentication in our app. Each customer can turn 2FA on and off for their users in app settings.

There was an idea to tweak this functionality. We would like to recognize a returning user with a flag about 2FA (if it's enabled or disabled) stored in cookie, and instead of displaying the Google code input in second step (after providing username and password) display it in the single form as {username, password, authentication code}.

I was trying to research this idea, but it seems nobody used it like that. Do you think it's a good idea? It makes the login process faster, limiting it to only one form.