aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2021-05-30 12:36:25 +0530
committerHarsh Shandilya <me@msfjarvis.dev>2021-05-30 12:36:25 +0530
commit5f83d6f2ffaa3bfc311bb5bd888790797c122f2b (patch)
tree72a19af9f6bc1f1d9012bfeb8962596e8c14562a
parent0de22d7f60f9ebe9532b775ba68d12d8c164adab (diff)
format-common: don't use hard-coded currentTimeMillis in TOTP logic
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
-rw-r--r--format-common/src/main/kotlin/dev/msfjarvis/aps/data/passfile/PasswordEntry.kt2
1 files changed, 1 insertions, 1 deletions
diff --git a/format-common/src/main/kotlin/dev/msfjarvis/aps/data/passfile/PasswordEntry.kt b/format-common/src/main/kotlin/dev/msfjarvis/aps/data/passfile/PasswordEntry.kt
index b2633c71..34288f50 100644
--- a/format-common/src/main/kotlin/dev/msfjarvis/aps/data/passfile/PasswordEntry.kt
+++ b/format-common/src/main/kotlin/dev/msfjarvis/aps/data/passfile/PasswordEntry.kt
@@ -87,7 +87,7 @@ constructor(
if (totpSecret != null) {
scope.launch {
updateTotp(clock.millis())
- val remainingTime = totpPeriod - (System.currentTimeMillis() % totpPeriod)
+ val remainingTime = totpPeriod - (clock.millis() % totpPeriod)
delay(Duration.seconds(remainingTime))
repeat(Int.MAX_VALUE) {
updateTotp(clock.millis())