Skip to content

Conversation

@gsnw-sebast
Copy link
Contributor

Some sites, such as PayPal and others, output the OTP string with spaces after every 4th character.

Entering this string results in the error message Secret is not in Base32.
However, removing the spaces makes it work. To be on the safe side, the pull request also removes the minus sign, too.

The pull request is untested because I don't have a suitable environment for testing and I haven't checked whether the other OTP variants contain spaces.

@daringer daringer self-requested a review November 11, 2025 20:15
Copy link
Collaborator

@daringer daringer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is only the "checker" functionality, which decides if the button is clickable - can you please also do this change before actually saving the otp-secret. This is here: https://github.com/Nitrokey/nitrokey-app2/blob/main/nitrokeyapp/secrets_tab/__init__.py#L855

@daringer
Copy link
Collaborator

oh and please rebase (for the ci to go through) and use verified commits - thanks

@gsnw-sebast
Copy link
Contributor Author

You mean line 842 where the secret is processed?

 otp_secret = self.ui.otp.text()

https://github.com/Nitrokey/nitrokey-app2/blob/b5ab2fa5b7da79f0f6ef1e80a6bc8508f6bb295a/nitrokeyapp/secrets_tab/__init__.py#L842C17-L842C48

@gsnw-sebast
Copy link
Contributor Author

I tested my change and it works with TOTP

@gsnw-sebast gsnw-sebast requested a review from daringer November 14, 2025 14:17
@daringer daringer merged commit c522abb into Nitrokey:main Nov 25, 2025
31 checks passed
@gsnw-sebast gsnw-sebast deleted the fix-totp branch November 27, 2025 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants