Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[auth] Fix bug in code generation

Neeraj Gupta710bb61f217e
diff --git a/auth/lib/utils/totp_util.dart b/auth/lib/utils/totp_util.dart
index 669f986cb5..6b7f53ae5b 100644
--- a/auth/lib/utils/totp_util.dart
+++ b/auth/lib/utils/totp_util.dart
@@ -63,12 +63,12 @@ String getNextTotp(Code code) {
final List<String> codes = [];
if (code.type == Type.steam || code.issuer.toLowerCase() == 'steam') {
final SteamTOTP steamTotp = SteamTOTP(secret: code.secret);
- for (int i = 1; i <= count; i++) {
+ for (int i = 0; i < count; i++) {
int generatedTime = startTime + code.period * 1000 * i;
codes.add(steamTotp.generate(generatedTime ~/ 1000));
}
} else {
- for (int i = 1; i <= count; i++) {
+ for (int i = 0; i < count; i++) {
int generatedTime = startTime + code.period * 1000 * i;
final genCode = otp.OTP.generateTOTPCodeString(
secret,