Фикс TOTP 2fa

This commit is contained in:
2026-05-21 23:06:43 +03:00
parent 99cb410919
commit 763334c488
2 changed files with 3 additions and 3 deletions

View File

@@ -100,8 +100,8 @@ fun TwoFaTokensScreen(
val scope = rememberCoroutineScope()
val nowMillis by produceState(initialValue = System.currentTimeMillis()) {
while (true) {
withFrameMillis { frameTimeMillis ->
value = frameTimeMillis
withFrameMillis {
value = System.currentTimeMillis()
}
}
}

View File

@@ -58,7 +58,7 @@ private fun generateTotpCode(
digits,
macAlgorithm,
)
val secretKey = SecretKeySpec(key, "RAW")
val secretKey = SecretKeySpec(key, macAlgorithm)
val otp = generator.generateOneTimePassword(
secretKey,
Instant.ofEpochMilli(nowMillis),