Expanded minimum secret length functionality so that the user is alerted if the length is not long enough. This fixed an issue where the user wasnt alerted about invalid secret length but was still able to click ok and submit the string, bypassing the base32 check altogether.

This commit is contained in:
Clay Perry committed 2025-07-04 10:50:25 -04:00
1 parent 9659b55bf3
commit 79e723545c
3 files changed
+9 -3

No files matched your search

@@ -216,6 +216,8 @@ data class OtpElement(var otpModel: OtpModel = OtpModel()) {
const val MIN_OTP_DIGITS = 4
const val MAX_OTP_DIGITS = 18
const val MIN_OTP_SECRET = 8
fun isValidCounter(counter: Long): Boolean {
return counter in MIN_HOTP_COUNTER..MAX_HOTP_COUNTER
}