mirror of
https://github.com/android-password-store/Android-Password-Store
synced 2025-08-31 14:25:28 +00:00
format-common: don't use hard-coded currentTimeMillis in TOTP logic
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
@@ -87,7 +87,7 @@ constructor(
|
|||||||
if (totpSecret != null) {
|
if (totpSecret != null) {
|
||||||
scope.launch {
|
scope.launch {
|
||||||
updateTotp(clock.millis())
|
updateTotp(clock.millis())
|
||||||
val remainingTime = totpPeriod - (System.currentTimeMillis() % totpPeriod)
|
val remainingTime = totpPeriod - (clock.millis() % totpPeriod)
|
||||||
delay(Duration.seconds(remainingTime))
|
delay(Duration.seconds(remainingTime))
|
||||||
repeat(Int.MAX_VALUE) {
|
repeat(Int.MAX_VALUE) {
|
||||||
updateTotp(clock.millis())
|
updateTotp(clock.millis())
|
||||||
|
Reference in New Issue
Block a user