google-authenticator-rails 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6def8934e47eae7221182c75a4da87dbbd83ab4b
4
- data.tar.gz: eff3167f67aa78e5c48a5666333a767a5e6a4e95
3
+ metadata.gz: be4ed80fe3da97670827efc04c0ff1894ef5306f
4
+ data.tar.gz: c0e7cce2b99528bcc3ddf35cfca281c538660c1d
5
5
  SHA512:
6
- metadata.gz: a5c4d4532c13fa333b384d35004b955a49322d9309df3cab6370b1270c621f44227fe570f5145d1819422d3c6346d1220076000d1259e2a43667baa2038aa059
7
- data.tar.gz: 15c6a5c57b5da5e2628aaa4a660c2228e358164dd65f26c4e3d1a5da2af5cac0ecea09cde2228006f892794da4b3b90d796a6409c113f5e7df5bef8e4dedcf19
6
+ metadata.gz: 69c2cfaf49bb6a89fbf011d3ea129f7d71f62a11f822203442d934122d593bd89e3483c434ad3d20919c32431cbb9786aeee82a9cc7b7a89ab3933a52af13c41
7
+ data.tar.gz: d6ff87c9561e9dc03019f353a09ef7255c53dd23080fda86c958195ccaa23ef3dbaadcac33710b4e39bf9891799172345086a267b06ee8b320d3cd0de880c4ae
data/README.md CHANGED
@@ -310,6 +310,13 @@ By default, the cookie related to the MfaSession expires in 24 hours, but this c
310
310
  GoogleAuthenticatorRails.time_until_expiration = 1.month
311
311
  ```
312
312
 
313
+ ## Destroying the Cookie
314
+
315
+ If you want to manually destroy the MFA cookie (for example, when a user logs out), just call
316
+
317
+ ```ruby
318
+ UserMfaSession::destroy
319
+ ```
313
320
 
314
321
  ## Contributing
315
322
 
@@ -31,6 +31,10 @@ module GoogleAuthenticatorRails
31
31
  new(user)
32
32
  end
33
33
 
34
+ def destroy
35
+ controller.cookies.delete cookie_key
36
+ end
37
+
34
38
  private
35
39
  def finder
36
40
  @_finder ||= klass.public_methods.include?(:where) ? :rails_3_finder : :rails_2_finder
@@ -1,7 +1,7 @@
1
1
  module Google
2
2
  module Authenticator
3
3
  module Rails
4
- VERSION = "1.0.0"
4
+ VERSION = "1.1.0"
5
5
  end
6
6
  end
7
7
  end
@@ -30,6 +30,14 @@ describe GoogleAuthenticatorRails::Session::Base do
30
30
  it { should be_a SaltUserMfaSession }
31
31
  its(:record) { should eq user }
32
32
  end
33
+
34
+ context 'after destroy' do
35
+ before { UserMfaSession.destroy }
36
+
37
+ subject { UserMfaSession.find }
38
+
39
+ it { should be_nil }
40
+ end
33
41
  end
34
42
  end
35
43
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-authenticator-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jared McFarland
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-14 00:00:00.000000000 Z
11
+ date: 2015-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rotp