Skip to content

Commit 0b7a4d6

Browse files
committed
Removes spaces and minus signs when saving the OTP entry
1 parent b5ab2fa commit 0b7a4d6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

nitrokeyapp/secrets_tab/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ def check_credential(self) -> None:
605605

606606
tool_Tip = "Credeantial cannot be saved:"
607607
can_save = True
608-
check_secret = self.ui.otp.text()
608+
check_secret = self.ui.otp.text().replace(" ", "").replace("-", "")
609609

610610
name_len = len(str.encode(self.ui.name.text()))
611611
username_len = len(str.encode(self.ui.username.text()))
@@ -839,7 +839,7 @@ def save_credential(self) -> None:
839839
otherKind = OtherKind.from_str(kind_str)
840840
else:
841841
kind = OtpKind.from_str(kind_str)
842-
otp_secret = self.ui.otp.text()
842+
otp_secret = self.ui.otp.text().replace(" ", "").replace("-", "")
843843
secret = parse_base32(otp_secret)
844844
except RuntimeError:
845845
pass

0 commit comments

Comments
 (0)