monich / harbour-foilauth

Secure OTP (One-Time Password) generator for Sailfish OS
https://openrepos.net/content/slava/foil-auth
Other
11 stars 6 forks source link

Handle timezones or time shift #36

Closed sppg closed 1 year ago

sppg commented 1 year ago

Dear Sirs, We are very happy using this application, and we would like to ask for an improvement. In fact, as we travel, we change the timezone and the TOTP is not working anymore, each time I had to change the date/time of the phone to get a working OTP then switch back to the local time. Would it be possible to add an option of a timeshift in the application? Thank you again for the great work Best regards

monich commented 1 year ago

This is strange, I'm using QDateTime::currentMSecsSinceEpoch() to get the current time, that returns is the number of milliseconds since 1970-01-01T00:00:00 UTC which doesn't depend on the time zone, as long as local time and time zone are correct on both ends (the server and the OTP app).

In any case, per-token time shift does make sense to handle broken clock (or more likely, time zone) on the server side. That would be a nice improvement - I'll give it a shot when I have some time to spare.

sppg commented 1 year ago

Thank you very much @monich for your fast response. In fact, the timezones are not updated that regularly on sailfishos, and I had the issue twice already (as I adjust the phone's time manually). And of course, I agree that this improvement would help also in case of wrongly set timezone on the server. I'm ready to betatest it whenever you ask me :) Cheers

monich commented 1 year ago

Hehe, timeshift is already in the UI, being encrypted, restored and everything... Just not being used 🙂

monich commented 1 year ago

That was easy (495c1d0)

monich commented 1 year ago

Timeshift should work in release 1.1.8

sppg commented 1 year ago

Thank you very much, the time I connected I found the 1.1.9 already :)

monich commented 1 year ago

Please test and if it works for you, close the issue

sppg commented 1 year ago

Works perfectly. Thank you again