You may have a look at this one:
For TOTP a quick and dirty fix may be applied (at your own risk, of course).