Two factor authentication on user register

Hi,

When using two factor authentication in the register user component, is there a way to only send the verification code after the input is validated? Currently when for example the passwords don’t match, it will first prompt to fill in the verification code, and afterwards it will just say “Passwords don’t match”.

            email, username, name = authenticator.register_user(
                pre_authorized=config['pre-authorized']['emails'],
                merge_username_email=True,
                location='main',
                domains=["gmail.com"],
                password_hint=False,
                captcha=False,
                two_factor_auth=True,
                clear_on_submit=True
            )