Instead of passing the Refresher object by reference, we now have the RefresherExitException that we could raise
If TOTP delete operation failed, raise doesn't really accomplish anything - we need to make sure we capture that error and register it.
Line 35: instead of only catching TypeError, we might want to also catch all the other exception, in case it's possible for pyotp library to raise some other exception.
It would also be useful to add a "TOTP test" token in the default config, for demonstration purposes
If the phone's date is not set correctly, TOTP will generate a wrong code. Can we do something about it?
It would also help to show the number of seconds before the code expires on the screen - if it's easy to determine
Also, in the main menu (where all the tokens are listed), we could use a "right button callback" for the "Delete TOTP" menu (instead of "press RIGHT in Refresher", which is not even mentioned in the UI). Later, some other actions could be added to that menu, too.
https://github.com/ZeroPhone/ZPUI/blob/a8ddaab62c05765bb4eec61cd354df8633951dee/apps/personal/totp_2fa/main.py#L64
Refresher
object by reference, we now have theRefresherExitException
that we could raiseraise
doesn't really accomplish anything - we need to make sure we capture that error and register it.TypeError
, we might want to also catch all the other exception, in case it's possible forpyotp
library to raise some other exception.