anjlab-devise-oauth2-providable 1.1.2 → 1.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,5 @@
1
1
  class Devise::Oauth2Providable::TokensController < ApplicationController
2
+ before_filter :clear_session
2
3
  before_filter :authenticate_user!
3
4
  skip_before_filter :verify_authenticity_token, :only => :create
4
5
 
@@ -9,8 +10,12 @@ class Devise::Oauth2Providable::TokensController < ApplicationController
9
10
  end
10
11
 
11
12
  private
13
+ def clear_session
14
+ session.clear
15
+ end
16
+
12
17
  def oauth2_current_client
13
- env[Devise::Oauth2Providable::CLIENT_ENV_REF]
18
+ env[Devise::Oauth2Providable::CLIENT_ENV_REF]
14
19
  end
15
20
 
16
21
  def oauth2_current_refresh_token
@@ -1,5 +1,5 @@
1
1
  module Devise
2
2
  module Oauth2Providable
3
- VERSION = "1.1.2"
3
+ VERSION = "1.1.3"
4
4
  end
5
5
  end
@@ -19,6 +19,15 @@ describe Devise::Strategies::Oauth2RefreshTokenGrantTypeStrategy do
19
19
  end
20
20
  it { response.code.to_i.should == 200 }
21
21
  it { response.content_type.should == 'application/json' }
22
+ it "returns second time too" do
23
+ params = {
24
+ :grant_type => 'refresh_token',
25
+ :client_id => client.identifier,
26
+ :client_secret => client.secret,
27
+ :refresh_token => @refresh_token.token
28
+ }
29
+ post '/oauth2/token', params
30
+ end
22
31
  it 'returns json' do
23
32
  token = Devise::Oauth2Providable::AccessToken.last
24
33
  refresh_token = @refresh_token
@@ -30,6 +39,8 @@ describe Devise::Strategies::Oauth2RefreshTokenGrantTypeStrategy do
30
39
  }
31
40
  response.body.should match_json(expected)
32
41
  end
42
+
43
+
33
44
  end
34
45
  context 'with expired refresh_token' do
35
46
  let(:user) { create(:user) }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anjlab-devise-oauth2-providable
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-22 00:00:00.000000000 Z
12
+ date: 2012-06-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: !ruby/object:Gem::Requirement
16
+ requirement: &70109259492180 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,15 +21,10 @@ dependencies:
21
21
  version: 3.2.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ! '>='
28
- - !ruby/object:Gem::Version
29
- version: 3.2.0
24
+ version_requirements: *70109259492180
30
25
  - !ruby/object:Gem::Dependency
31
26
  name: devise
32
- requirement: !ruby/object:Gem::Requirement
27
+ requirement: &70109259489680 !ruby/object:Gem::Requirement
33
28
  none: false
34
29
  requirements:
35
30
  - - ! '>='
@@ -37,15 +32,10 @@ dependencies:
37
32
  version: 2.1.0
38
33
  type: :runtime
39
34
  prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ! '>='
44
- - !ruby/object:Gem::Version
45
- version: 2.1.0
35
+ version_requirements: *70109259489680
46
36
  - !ruby/object:Gem::Dependency
47
37
  name: rack-oauth2
48
- requirement: !ruby/object:Gem::Requirement
38
+ requirement: &70109259487300 !ruby/object:Gem::Requirement
49
39
  none: false
50
40
  requirements:
51
41
  - - ~>
@@ -53,15 +43,10 @@ dependencies:
53
43
  version: 0.14.4
54
44
  type: :runtime
55
45
  prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
- requirements:
59
- - - ~>
60
- - !ruby/object:Gem::Version
61
- version: 0.14.4
46
+ version_requirements: *70109259487300
62
47
  - !ruby/object:Gem::Dependency
63
48
  name: rspec-rails
64
- requirement: !ruby/object:Gem::Requirement
49
+ requirement: &70109259482660 !ruby/object:Gem::Requirement
65
50
  none: false
66
51
  requirements:
67
52
  - - ! '>='
@@ -69,15 +54,10 @@ dependencies:
69
54
  version: 2.6.2
70
55
  type: :development
71
56
  prerelease: false
72
- version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
- requirements:
75
- - - ! '>='
76
- - !ruby/object:Gem::Version
77
- version: 2.6.2
57
+ version_requirements: *70109259482660
78
58
  - !ruby/object:Gem::Dependency
79
59
  name: sqlite3
80
- requirement: !ruby/object:Gem::Requirement
60
+ requirement: &70109259481100 !ruby/object:Gem::Requirement
81
61
  none: false
82
62
  requirements:
83
63
  - - ! '>='
@@ -85,15 +65,10 @@ dependencies:
85
65
  version: '0'
86
66
  type: :development
87
67
  prerelease: false
88
- version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
- requirements:
91
- - - ! '>='
92
- - !ruby/object:Gem::Version
93
- version: '0'
68
+ version_requirements: *70109259481100
94
69
  - !ruby/object:Gem::Dependency
95
70
  name: shoulda-matchers
96
- requirement: !ruby/object:Gem::Requirement
71
+ requirement: &70109259478600 !ruby/object:Gem::Requirement
97
72
  none: false
98
73
  requirements:
99
74
  - - ! '>='
@@ -101,15 +76,10 @@ dependencies:
101
76
  version: 1.0.0
102
77
  type: :development
103
78
  prerelease: false
104
- version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
- requirements:
107
- - - ! '>='
108
- - !ruby/object:Gem::Version
109
- version: 1.0.0
79
+ version_requirements: *70109259478600
110
80
  - !ruby/object:Gem::Dependency
111
81
  name: pry-rails
112
- requirement: !ruby/object:Gem::Requirement
82
+ requirement: &70109259476800 !ruby/object:Gem::Requirement
113
83
  none: false
114
84
  requirements:
115
85
  - - ! '>='
@@ -117,15 +87,10 @@ dependencies:
117
87
  version: '0'
118
88
  type: :development
119
89
  prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
- requirements:
123
- - - ! '>='
124
- - !ruby/object:Gem::Version
125
- version: '0'
90
+ version_requirements: *70109259476800
126
91
  - !ruby/object:Gem::Dependency
127
92
  name: factory_girl_rspec
128
- requirement: !ruby/object:Gem::Requirement
93
+ requirement: &70109259474140 !ruby/object:Gem::Requirement
129
94
  none: false
130
95
  requirements:
131
96
  - - ! '>='
@@ -133,15 +98,10 @@ dependencies:
133
98
  version: 0.0.1
134
99
  type: :development
135
100
  prerelease: false
136
- version_requirements: !ruby/object:Gem::Requirement
137
- none: false
138
- requirements:
139
- - - ! '>='
140
- - !ruby/object:Gem::Version
141
- version: 0.0.1
101
+ version_requirements: *70109259474140
142
102
  - !ruby/object:Gem::Dependency
143
103
  name: rake
144
- requirement: !ruby/object:Gem::Requirement
104
+ requirement: &70109259471900 !ruby/object:Gem::Requirement
145
105
  none: false
146
106
  requirements:
147
107
  - - ! '>='
@@ -149,12 +109,7 @@ dependencies:
149
109
  version: 0.9.2.2
150
110
  type: :development
151
111
  prerelease: false
152
- version_requirements: !ruby/object:Gem::Requirement
153
- none: false
154
- requirements:
155
- - - ! '>='
156
- - !ruby/object:Gem::Version
157
- version: 0.9.2.2
112
+ version_requirements: *70109259471900
158
113
  description: Rails3 engine that adds OAuth2 Provider support to any application built
159
114
  with Devise authentication
160
115
  email:
@@ -264,15 +219,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
264
219
  - - ! '>='
265
220
  - !ruby/object:Gem::Version
266
221
  version: '0'
222
+ segments:
223
+ - 0
224
+ hash: 2127156306996471334
267
225
  required_rubygems_version: !ruby/object:Gem::Requirement
268
226
  none: false
269
227
  requirements:
270
228
  - - ! '>='
271
229
  - !ruby/object:Gem::Version
272
230
  version: '0'
231
+ segments:
232
+ - 0
233
+ hash: 2127156306996471334
273
234
  requirements: []
274
235
  rubyforge_project:
275
- rubygems_version: 1.8.22
236
+ rubygems_version: 1.8.17
276
237
  signing_key:
277
238
  specification_version: 3
278
239
  summary: OAuth2 Provider for Rails3 applications with Devise 2.1.0