8000 pyotp.parse_uri does not convert 'interval' or 'counter' to int · Issue #108 · pyauth/pyotp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
pyotp.parse_uri does not convert 'interval' or 'counter' to int #108
Closed
@kemlath

Description

@kemlath

OTP uri's that specify a period or initial count do not work since they are stored as str instead of int.
This makes e.g. totp.now() fail because totp.timecode() divides by self.interval which currently is a str when period is specified in the uri.

Simple fix in parse_uri line 87 and 89 cast to int:

elif key == 'period':
otp_data['interval'] = int(value)
elif key == 'counter':
otp_data['initial_count'] = int(value)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0