Fallback to a 30 second period if an andOTP doesn't provide one

This commit is contained in:
Alexander Bakker 2019-04-01 23:48:15 +02:00
parent a251685002
commit 4c1dec613c

View file

@ -69,7 +69,7 @@ public class AndOtpFileImporter extends DatabaseFileImporter {
info = new TotpInfo(secret, algo, digits, obj.getInt("period")); info = new TotpInfo(secret, algo, digits, obj.getInt("period"));
break; break;
case "steam": case "steam":
info = new SteamInfo(secret, algo, digits, obj.getInt("period")); info = new SteamInfo(secret, algo, digits, obj.optInt("period", 30));
break; break;
default: default:
throw new DatabaseImporterException("unsupported otp type: " + type); throw new DatabaseImporterException("unsupported otp type: " + type);