lib/otp/totp.rb in otp-0.0.9 vs lib/otp/totp.rb in otp-0.0.10

- old
+ new

@@ -14,18 +14,17 @@ def moving_factor return (time || Time.now).to_i / period end - def type_specific_uri_params - params = {} + def uri_params + params = super params["period"] = period if period != DEFAULT_PERIOD return params end - def extract_type_specific_uri_params(query) - if value = query["period"] - self.period = value.to_i - end + def extract_uri_params(params) + super + self.period = (params["period"] || period).to_i end end end