onetimepass icon indicating copy to clipboard operation
onetimepass copied to clipboard

Token length sometimes vary

Open tabotkevin opened this issue 1 year ago • 1 comments

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 avatar Sep 29 '23 09:09 tabotkevin

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.

icb- avatar Oct 02 '23 16:10 icb-