Start the timer when opening the app
Sometime when I open the app only a few seconds remain before the next code is shown.
IMO all services have a time window where expired codes are still accepted.
I think the UX would be better if you start the count down with the 'ring' full instead of the real value.
The timer is synchronized with your service provider during activation of 2FA process to create the very bond that keeps everything secure. This cannot be change for the purpose of convenience as it would render the encryption mechanism worthless.
If you open Authentication and it's about to refresh, you can wait the 4 seconds that it takes and them use the new code or set of codes.
@webdev3301 All services understand the concept of a time window - if your clock is off by a few seconds (or the servers clock), the token will still be accepted.
So yes, you can improve the UX by using this window.
I wouldn't want to rely too heavily on a service having a generous time window, but I do see the annoyance of opening the app to have it show you a code only for a few seconds.
Instead of starting the timer when the app opens and having it remain shifted from the "true" time cycle, a better approach might be to detect if the app is opened within a few seconds of a token expiring, and to preemptively show the next code. If done right, this might result in the first code being shown for ~35 seconds, and then return to a regular 30-second cycle after.
Thanks for the suggestion! It would be tricky to get it just right, but I'll definitely consider it.