Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Token length sometimes vary #33

Open
tabotkevin opened this issue Sep 29, 2023 · 1 comment
Open

Token length sometimes vary #33

tabotkevin opened this issue Sep 29, 2023 · 1 comment

Comments

@tabotkevin
Copy link

The default token_length is 6, but sometime get_totp returns tokens with lengths of 5. You can see from the last value in the screenshot attached.
Screenshot 2023-09-29 at 10 44 13 AM

@tabotkevin tabotkevin changed the title Token length sometimes varies. Token length sometimes vary Sep 29, 2023
@icb-
Copy link

icb- commented Oct 2, 2023

The token code is being returned as an integer. If it's shorter than token_length then it has leading zeros. Pass as_string as a truthy value to get it as a string with leading zeroes includes.

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

No branches or pull requests

2 participants