devise-access_token_authenticatable 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  module Devise
2
2
  module AccessTokenAuthenticatable
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
@@ -9,12 +9,20 @@ module Devise
9
9
  access_token.invalidate! if access_token
10
10
  end
11
11
 
12
+ def set_authentication_token!
13
+ self.access_token = access_tokens.create!
14
+ save(:validate => false)
15
+ end
16
+
17
+ def ensure_authentication_token!
18
+ set_authentication_token! unless access_token
19
+ end
20
+
12
21
  # TODO Remove this entirely. A user should be able to have many access
13
22
  # tokens, that should expire after a period of time.
14
23
  def reset_authentication_token!
15
24
  invalidate_authentication_token!
16
- self.access_token = access_tokens.create!
17
- save(:validate => false)
25
+ set_authentication_token!
18
26
  end
19
27
 
20
28
  def authentication_token
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise-access_token_authenticatable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-08-12 00:00:00.000000000 Z
12
+ date: 2013-09-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: devise
@@ -92,7 +92,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
92
92
  version: '0'
93
93
  segments:
94
94
  - 0
95
- hash: 2414664795423883497
95
+ hash: -2052685112740984896
96
96
  required_rubygems_version: !ruby/object:Gem::Requirement
97
97
  none: false
98
98
  requirements:
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
101
  version: '0'
102
102
  segments:
103
103
  - 0
104
- hash: 2414664795423883497
104
+ hash: -2052685112740984896
105
105
  requirements: []
106
106
  rubyforge_project:
107
107
  rubygems_version: 1.8.23