diff --git a/src/main/java/com/cringe_studios/cringe_authenticator_library/OTP.java b/src/main/java/com/cringe_studios/cringe_authenticator_library/OTP.java index dca737d..47381e4 100644 --- a/src/main/java/com/cringe_studios/cringe_authenticator_library/OTP.java +++ b/src/main/java/com/cringe_studios/cringe_authenticator_library/OTP.java @@ -45,7 +45,7 @@ public abstract class OTP { * @param counter REQUIRED if HOTP, otherwise meaningless. The initial counter for HOTP (eg 21, if user reloaded counter 21 times) * @param periodInSeconds OPTIONAL (default 30) for TOTP, the refresh rate of the TOTP * @param checksum OPTIONAL: appends a checksum digit to the end of the string - * @return returns your wallet to the lost-and-found office + * @return returns a valid OTP object or null, which can be used to create a new OTP pin */ public static OTP createNewOTP(OTPType type, String secret, OTPAlgorithm algorithm, int digits, long counter, long periodInSeconds, boolean checksum) throws OTPException{ if(type == null) return null; diff --git a/src/main/java/com/cringe_studios/cringe_authenticator_library/OTPType.java b/src/main/java/com/cringe_studios/cringe_authenticator_library/OTPType.java index 6c59f1f..d636d64 100644 --- a/src/main/java/com/cringe_studios/cringe_authenticator_library/OTPType.java +++ b/src/main/java/com/cringe_studios/cringe_authenticator_library/OTPType.java @@ -17,7 +17,7 @@ public enum OTPType { } public OTP instance(String secret, OTPAlgorithm algorithm, int digits, long counter, long periodInSeconds, boolean checksum) { - if(/*type == null ||*/ secret == null /*|| counter < 0*/) { + if(/*type == null ||*/ secret == null || secret.length() == 0/*|| counter < 0*/) { return null; }