emailauth 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/emailauth/authenticator.rb +3 -2
  2. metadata +2 -2
@@ -29,10 +29,11 @@ class EmailAuth::Authenticator
29
29
  end
30
30
 
31
31
  ##
32
- # Validates whether a TOTP code is valid for a particular secret
32
+ # Validates whether a TOTP code is valid for a particular secret.
33
+ # Allows for a 30 second max transmission delay
33
34
  ##
34
35
  def self.validateTOTP(auth_secret, code)
35
- return code == ROTP::TOTP.new(auth_secret).now.to_s
36
+ return ROTP::TOTP.new(auth_secret).verify_with_drift(code, 30)
36
37
  end
37
38
 
38
39
  ##
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: emailauth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -54,7 +54,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
54
54
  requirements:
55
55
  - - ! '>='
56
56
  - !ruby/object:Gem::Version
57
- version: 0.0.2
57
+ version: '0'
58
58
  requirements: []
59
59
  rubyforge_project:
60
60
  rubygems_version: 1.8.23