Фикс TOTP 2fa
This commit is contained in:
@@ -100,8 +100,8 @@ fun TwoFaTokensScreen(
|
|||||||
val scope = rememberCoroutineScope()
|
val scope = rememberCoroutineScope()
|
||||||
val nowMillis by produceState(initialValue = System.currentTimeMillis()) {
|
val nowMillis by produceState(initialValue = System.currentTimeMillis()) {
|
||||||
while (true) {
|
while (true) {
|
||||||
withFrameMillis { frameTimeMillis ->
|
withFrameMillis {
|
||||||
value = frameTimeMillis
|
value = System.currentTimeMillis()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ private fun generateTotpCode(
|
|||||||
digits,
|
digits,
|
||||||
macAlgorithm,
|
macAlgorithm,
|
||||||
)
|
)
|
||||||
val secretKey = SecretKeySpec(key, "RAW")
|
val secretKey = SecretKeySpec(key, macAlgorithm)
|
||||||
val otp = generator.generateOneTimePassword(
|
val otp = generator.generateOneTimePassword(
|
||||||
secretKey,
|
secretKey,
|
||||||
Instant.ofEpochMilli(nowMillis),
|
Instant.ofEpochMilli(nowMillis),
|
||||||
|
|||||||
Reference in New Issue
Block a user