Derbosik The same error was made when the extension Draft was updated by Ianm, seems same error is happening after this update, reading your message. You may need wait a reply and maybe an update fix.
I'm using a different two facto extension so I don't have this issue and never try this extension yet π
I hope in the future Flarum can have some workflow that avoid extension to create this error that forbid admin to access the admin side and also front end side.
For remove the error you may remove the extension:
# composer remove require ianm/twofactor
Be sure to made a backup before do this, two factor will be disabled if the extension is removed.