Thunderbird and Gmail with two-factor authentication

Today, Google forcibly switched me to two-factor authentication. In result, Gmail on Thunderbird stopped working. After disabling two-factor authentication it started to work again.

Is there a way to configure Thunderbird or Gmail to have two-factor authentication and still have working gmail on Thunderbird? I haven’t found any useful answer online :frowning: .

It looks like the same problem was for older version and now history repeats itself, but now there is no newer version to update to:

https://support.google.com/accounts/thread/18430011/can-t-login-to-gmail-account-via-thunderbird-with-2fa-despite-using-app-password?hl=en

So I’m still left with nothing. I can’t find any setting in Thunderbird to re-autheticate the app.