diff --git a/AuthenticatorPro.Core/src/Converter/TwoFasBackupConverter.cs b/AuthenticatorPro.Core/src/Converter/TwoFasBackupConverter.cs index 092df1a868..19bc00dc3a 100644 --- a/AuthenticatorPro.Core/src/Converter/TwoFasBackupConverter.cs +++ b/AuthenticatorPro.Core/src/Converter/TwoFasBackupConverter.cs @@ -194,13 +194,21 @@ public Authenticator Convert(IIconResolver iconResolver) username = Otp.Account; } + var digits = Otp.Digits > 0 + ? Otp.Digits + : type.GetDefaultDigits(); + + var period = Otp.Period > 0 + ? Otp.Period + : type.GetDefaultPeriod(); + return new Authenticator { Secret = SecretUtil.Clean(Secret, type), Issuer = issuer.Truncate(Authenticator.IssuerMaxLength), Username = username.Truncate(Authenticator.UsernameMaxLength), - Digits = Otp.Digits, - Period = Otp.Period, + Digits = digits, + Period = period, Counter = Otp.Counter, Type = type, Algorithm = algorithm,