nc 24 upgrade broke TOTP authentication

This was reported by @duncan in #6 (comment 2806137):

So I've had my Nextcloud account set up to use 2fa with an app-generated passcode for the better part of a year now, however since last week I've starting receiving this error after entering my username and password:

nextcloud-2fa-error

At present I can't actually log in to Nextcloud :s

I believe this is because somehow the recent Nextcloud upgrade broke TOTP authentication.