devise_cas_authenticatable 1.1.4 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +3 -1
- data/CHANGELOG.md +4 -0
- data/app/controllers/devise/cas_sessions_controller.rb +7 -18
- data/devise_cas_authenticatable.gemspec +1 -1
- data/lib/devise_cas_authenticatable.rb +2 -8
- data/lib/devise_cas_authenticatable/railtie.rb +10 -0
- data/lib/devise_cas_authenticatable/single_sign_out.rb +51 -11
- data/lib/devise_cas_authenticatable/single_sign_out/rack.rb +30 -0
- data/lib/devise_cas_authenticatable/single_sign_out/strategies/rails_cache.rb +1 -1
- data/lib/devise_cas_authenticatable/strategy.rb +0 -1
- metadata +40 -40
- data/lib/devise_cas_authenticatable/single_sign_out/session_store/active_record.rb +0 -12
- data/lib/devise_cas_authenticatable/single_sign_out/session_store/redis.rb +0 -27
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Changelog for devise\_cas\_authenticatable
|
2
2
|
|
3
|
+
## Version 1.2.0 - March 6, 2013
|
4
|
+
|
5
|
+
* Rewrite of the single sign-out module to improve compatibility with newer Devise versions, other ORMs, and be less complex overall (thanks [Jeremy Haile](https://github.com/jeremyhaile) and [Endel Dreyer](https://github.com/endel)!)
|
6
|
+
|
3
7
|
## Version 1.1.4 - January 23, 2013
|
4
8
|
|
5
9
|
* Bug fix: don't modify request.protocol when generating a logout_url (thanks [Tse-Ching Ho](https://github.com/tsechingho)!)
|
@@ -1,6 +1,9 @@
|
|
1
|
-
class Devise::CasSessionsController < Devise::SessionsController
|
1
|
+
class Devise::CasSessionsController < Devise::SessionsController
|
2
|
+
include DeviseCasAuthenticatable::SingleSignOut::DestroySession
|
2
3
|
unloadable
|
3
4
|
|
5
|
+
skip_before_filter :verify_authenticity_token, :only => [:single_sign_out]
|
6
|
+
|
4
7
|
def new
|
5
8
|
unless returning_from_cas?
|
6
9
|
redirect_to(cas_login_url)
|
@@ -15,11 +18,6 @@ class Devise::CasSessionsController < Devise::SessionsController
|
|
15
18
|
end
|
16
19
|
|
17
20
|
def destroy
|
18
|
-
# Delete the ticket->session ID mapping if one exists for this session
|
19
|
-
if ticket = session['cas_last_valid_ticket']
|
20
|
-
::DeviseCasAuthenticatable::SingleSignOut::Strategies.current_strategy.delete_session_index(ticket)
|
21
|
-
end
|
22
|
-
|
23
21
|
# if :cas_create_user is false a CAS session might be open but not signed_in
|
24
22
|
# in such case we destroy the session here
|
25
23
|
if signed_in?(resource_name)
|
@@ -64,23 +62,14 @@ class Devise::CasSessionsController < Devise::SessionsController
|
|
64
62
|
end
|
65
63
|
|
66
64
|
def destroy_cas_session(session_id, session_index)
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
else
|
71
|
-
logger.debug "Data for session #{session_id} was not found. It may have already been cleared by a local CAS logout request."
|
72
|
-
end
|
73
|
-
else
|
74
|
-
logger.warn "A single sign out request was received for ticket #{session_index} but the Rails session_store is not a type supported for single-sign-out by devise_cas_authenticatable."
|
65
|
+
logger.debug "Destroying cas session #{session_id} for ticket #{session_index}"
|
66
|
+
if destroy_session_by_id(session_id)
|
67
|
+
logger.debug "Destroyed session #{session_id} corresponding to service ticket #{session_index}."
|
75
68
|
end
|
76
69
|
|
77
70
|
::DeviseCasAuthenticatable::SingleSignOut::Strategies.current_strategy.delete_session_index(session_index)
|
78
71
|
end
|
79
72
|
|
80
|
-
def session_store
|
81
|
-
@session_store ||= (Rails.respond_to?(:application) && Rails.application.config.session_store)
|
82
|
-
end
|
83
|
-
|
84
73
|
def returning_from_cas?
|
85
74
|
params[:ticket] || request.referer =~ /^#{::Devise.cas_client.cas_base_url}/ || request.referer =~ /^#{url_for :action => "service"}/
|
86
75
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{devise_cas_authenticatable}
|
5
|
-
s.version = "1.
|
5
|
+
s.version = "1.2.0"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Nat Budin", "Jeremy Haile"]
|
@@ -7,16 +7,10 @@ require 'devise_cas_authenticatable/exceptions'
|
|
7
7
|
|
8
8
|
require 'devise_cas_authenticatable/single_sign_out'
|
9
9
|
|
10
|
-
if defined?(ActiveRecord::SessionStore)
|
11
|
-
require 'devise_cas_authenticatable/single_sign_out/session_store/active_record'
|
12
|
-
end
|
13
|
-
|
14
|
-
if defined?(Redis::Store)
|
15
|
-
require 'devise_cas_authenticatable/single_sign_out/session_store/redis'
|
16
|
-
end
|
17
|
-
|
18
10
|
require 'rubycas-client'
|
19
11
|
|
12
|
+
require 'devise_cas_authenticatable/railtie' if defined?(Rails::Railtie)
|
13
|
+
|
20
14
|
# Register as a Rails engine if Rails::Engine exists
|
21
15
|
begin
|
22
16
|
Rails::Engine
|
@@ -0,0 +1,10 @@
|
|
1
|
+
require 'devise_cas_authenticatable'
|
2
|
+
require 'rails'
|
3
|
+
|
4
|
+
module DeviseCasAuthenticatable
|
5
|
+
class Railtie < ::Rails::Railtie
|
6
|
+
initializer "devise_cas_authenticatable.use_rack_middleware" do |app|
|
7
|
+
app.config.middleware.use "DeviseCasAuthenticatable::SingleSignOut::StoreSessionId"
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
@@ -1,22 +1,62 @@
|
|
1
1
|
module DeviseCasAuthenticatable
|
2
2
|
module SingleSignOut
|
3
|
-
module SetSession
|
4
|
-
def set_session_with_storage(env, sid, session_data, options={})
|
5
|
-
if session_data['cas_last_valid_ticket_store']
|
6
|
-
::DeviseCasAuthenticatable::SingleSignOut::Strategies.current_strategy.store_session_id_for_index(session_data['cas_last_valid_ticket'], sid)
|
7
|
-
session_data['cas_last_valid_ticket_store'] = nil
|
8
|
-
end
|
9
3
|
|
10
|
-
|
11
|
-
|
4
|
+
def self.rails3?
|
5
|
+
defined?(::Rails) && ::Rails::VERSION::MAJOR == 3
|
6
|
+
end
|
7
|
+
|
8
|
+
# Supports destroying sessions by ID for ActiveRecord and Redis session stores
|
9
|
+
module DestroySession
|
10
|
+
def session_store_class
|
11
|
+
@session_store_class ||=
|
12
|
+
begin
|
13
|
+
if ::DeviseCasAuthenticatable::SingleSignOut.rails3?
|
14
|
+
# => Rails 3
|
15
|
+
Rails.configuration.session_store
|
16
|
+
::Rails.application.config.session_store
|
17
|
+
else
|
18
|
+
# => Rails 2
|
19
|
+
ActionController::Base.session_store
|
20
|
+
end
|
21
|
+
rescue NameError => e
|
22
|
+
# for older versions of Rails (prior to 2.3)
|
23
|
+
ActionController::Base.session_options[:database_manager]
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def current_session_store
|
28
|
+
app = Rails.application.app
|
29
|
+
begin
|
30
|
+
app = (app.instance_variable_get(:@backend) || app.instance_variable_get(:@app))
|
31
|
+
end until app.nil? or app.class == session_store_class
|
32
|
+
app
|
33
|
+
end
|
34
|
+
|
35
|
+
def destroy_session_by_id(sid)
|
36
|
+
logger.debug "Single Sign Out from session store: #{current_session_store.inspect}"
|
37
|
+
|
38
|
+
if session_store_class.name =~ /ActiveRecord::SessionStore/
|
39
|
+
session = session_store_class::Session.find_by_session_id(sid)
|
40
|
+
session.destroy if session
|
41
|
+
true
|
42
|
+
elsif session_store_class.name =~ /Redis/
|
43
|
+
current_session_store.instance_variable_get(:@pool).del(sid)
|
44
|
+
true
|
45
|
+
elsif session_store_class.name =~ /CacheStore/
|
46
|
+
current_session_store.destroy_session({}, sid, {})
|
47
|
+
true
|
12
48
|
else
|
13
|
-
|
14
|
-
|
49
|
+
logger.error "Cannot process logout request because this Rails application's session store is "+
|
50
|
+
" #{current_session_store.name.inspect} and is not a support session store type for Single Sign-Out."
|
51
|
+
false
|
52
|
+
end
|
15
53
|
end
|
16
54
|
end
|
55
|
+
|
17
56
|
end
|
18
57
|
end
|
19
58
|
|
20
59
|
require 'devise_cas_authenticatable/single_sign_out/strategies'
|
21
60
|
require 'devise_cas_authenticatable/single_sign_out/strategies/base'
|
22
|
-
require 'devise_cas_authenticatable/single_sign_out/strategies/rails_cache'
|
61
|
+
require 'devise_cas_authenticatable/single_sign_out/strategies/rails_cache'
|
62
|
+
require 'devise_cas_authenticatable/single_sign_out/rack'
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module DeviseCasAuthenticatable
|
2
|
+
module SingleSignOut
|
3
|
+
|
4
|
+
class StoreSessionId
|
5
|
+
def initialize(app)
|
6
|
+
@app = app
|
7
|
+
end
|
8
|
+
|
9
|
+
def call(env)
|
10
|
+
store_session_id_for_cas_ticket(env)
|
11
|
+
@app.call(env)
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def store_session_id_for_cas_ticket(env)
|
17
|
+
request = Rack::Request.new(env)
|
18
|
+
session = request.session
|
19
|
+
|
20
|
+
if session['cas_last_valid_ticket_store']
|
21
|
+
sid = env['rack.session.options'][:id]
|
22
|
+
Rails.logger.info "Storing sid #{sid} for ticket #{session['cas_last_valid_ticket']}"
|
23
|
+
::DeviseCasAuthenticatable::SingleSignOut::Strategies.current_strategy.store_session_id_for_index(session['cas_last_valid_ticket'], sid)
|
24
|
+
session['cas_last_valid_ticket_store'] = false
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -28,4 +28,4 @@ module DeviseCasAuthenticatable
|
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
|
-
::DeviseCasAuthenticatable::SingleSignOut::Strategies.add( :rails_cache, DeviseCasAuthenticatable::SingleSignOut::Strategies::RailsCache )
|
31
|
+
::DeviseCasAuthenticatable::SingleSignOut::Strategies.add( :rails_cache, DeviseCasAuthenticatable::SingleSignOut::Strategies::RailsCache )
|
@@ -27,7 +27,6 @@ module Devise
|
|
27
27
|
elsif ticket.is_valid?
|
28
28
|
username = ticket.respond_to?(:user) ? ticket.user : ticket.response.user
|
29
29
|
redirect!(::Devise.cas_unregistered_url(request.url, mapping), :username => username)
|
30
|
-
#fail!("The user #{ticket.response.user} is not registered with this site. Please use a different account.")
|
31
30
|
else
|
32
31
|
fail!(:invalid)
|
33
32
|
end
|
metadata
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise_cas_authenticatable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.4
|
5
4
|
prerelease:
|
5
|
+
version: 1.2.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Nat Budin
|
@@ -10,195 +10,195 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-
|
13
|
+
date: 2013-03-06 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
|
+
type: :runtime
|
17
|
+
version_requirements: !ruby/object:Gem::Requirement
|
18
|
+
none: false
|
19
|
+
requirements:
|
20
|
+
- - ! '>='
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 1.0.6
|
16
23
|
name: devise
|
24
|
+
prerelease: false
|
17
25
|
requirement: !ruby/object:Gem::Requirement
|
18
26
|
none: false
|
19
27
|
requirements:
|
20
28
|
- - ! '>='
|
21
29
|
- !ruby/object:Gem::Version
|
22
30
|
version: 1.0.6
|
31
|
+
- !ruby/object:Gem::Dependency
|
23
32
|
type: :runtime
|
24
|
-
prerelease: false
|
25
33
|
version_requirements: !ruby/object:Gem::Requirement
|
26
34
|
none: false
|
27
35
|
requirements:
|
28
36
|
- - ! '>='
|
29
37
|
- !ruby/object:Gem::Version
|
30
|
-
version:
|
31
|
-
- !ruby/object:Gem::Dependency
|
38
|
+
version: 2.2.1
|
32
39
|
name: rubycas-client
|
40
|
+
prerelease: false
|
33
41
|
requirement: !ruby/object:Gem::Requirement
|
34
42
|
none: false
|
35
43
|
requirements:
|
36
44
|
- - ! '>='
|
37
45
|
- !ruby/object:Gem::Version
|
38
46
|
version: 2.2.1
|
39
|
-
|
40
|
-
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
type: :development
|
41
49
|
version_requirements: !ruby/object:Gem::Requirement
|
42
50
|
none: false
|
43
51
|
requirements:
|
44
52
|
- - ! '>='
|
45
53
|
- !ruby/object:Gem::Version
|
46
|
-
version:
|
47
|
-
- !ruby/object:Gem::Dependency
|
54
|
+
version: 3.0.7
|
48
55
|
name: rails
|
56
|
+
prerelease: false
|
49
57
|
requirement: !ruby/object:Gem::Requirement
|
50
58
|
none: false
|
51
59
|
requirements:
|
52
60
|
- - ! '>='
|
53
61
|
- !ruby/object:Gem::Version
|
54
62
|
version: 3.0.7
|
63
|
+
- !ruby/object:Gem::Dependency
|
55
64
|
type: :development
|
56
|
-
prerelease: false
|
57
65
|
version_requirements: !ruby/object:Gem::Requirement
|
58
66
|
none: false
|
59
67
|
requirements:
|
60
68
|
- - ! '>='
|
61
69
|
- !ruby/object:Gem::Version
|
62
|
-
version:
|
63
|
-
- !ruby/object:Gem::Dependency
|
70
|
+
version: '0'
|
64
71
|
name: rspec-rails
|
72
|
+
prerelease: false
|
65
73
|
requirement: !ruby/object:Gem::Requirement
|
66
74
|
none: false
|
67
75
|
requirements:
|
68
76
|
- - ! '>='
|
69
77
|
- !ruby/object:Gem::Version
|
70
78
|
version: '0'
|
79
|
+
- !ruby/object:Gem::Dependency
|
71
80
|
type: :development
|
72
|
-
prerelease: false
|
73
81
|
version_requirements: !ruby/object:Gem::Requirement
|
74
82
|
none: false
|
75
83
|
requirements:
|
76
84
|
- - ! '>='
|
77
85
|
- !ruby/object:Gem::Version
|
78
86
|
version: '0'
|
79
|
-
- !ruby/object:Gem::Dependency
|
80
87
|
name: mocha
|
88
|
+
prerelease: false
|
81
89
|
requirement: !ruby/object:Gem::Requirement
|
82
90
|
none: false
|
83
91
|
requirements:
|
84
92
|
- - ! '>='
|
85
93
|
- !ruby/object:Gem::Version
|
86
94
|
version: '0'
|
95
|
+
- !ruby/object:Gem::Dependency
|
87
96
|
type: :development
|
88
|
-
prerelease: false
|
89
97
|
version_requirements: !ruby/object:Gem::Requirement
|
90
98
|
none: false
|
91
99
|
requirements:
|
92
100
|
- - ! '>='
|
93
101
|
- !ruby/object:Gem::Version
|
94
102
|
version: '0'
|
95
|
-
- !ruby/object:Gem::Dependency
|
96
103
|
name: shoulda
|
104
|
+
prerelease: false
|
97
105
|
requirement: !ruby/object:Gem::Requirement
|
98
106
|
none: false
|
99
107
|
requirements:
|
100
108
|
- - ! '>='
|
101
109
|
- !ruby/object:Gem::Version
|
102
110
|
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
103
112
|
type: :development
|
104
|
-
prerelease: false
|
105
113
|
version_requirements: !ruby/object:Gem::Requirement
|
106
114
|
none: false
|
107
115
|
requirements:
|
108
116
|
- - ! '>='
|
109
117
|
- !ruby/object:Gem::Version
|
110
118
|
version: '0'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
119
|
name: sqlite3-ruby
|
120
|
+
prerelease: false
|
113
121
|
requirement: !ruby/object:Gem::Requirement
|
114
122
|
none: false
|
115
123
|
requirements:
|
116
124
|
- - ! '>='
|
117
125
|
- !ruby/object:Gem::Version
|
118
126
|
version: '0'
|
127
|
+
- !ruby/object:Gem::Dependency
|
119
128
|
type: :development
|
120
|
-
prerelease: false
|
121
129
|
version_requirements: !ruby/object:Gem::Requirement
|
122
130
|
none: false
|
123
131
|
requirements:
|
124
132
|
- - ! '>='
|
125
133
|
- !ruby/object:Gem::Version
|
126
134
|
version: '0'
|
127
|
-
- !ruby/object:Gem::Dependency
|
128
135
|
name: sham_rack
|
136
|
+
prerelease: false
|
129
137
|
requirement: !ruby/object:Gem::Requirement
|
130
138
|
none: false
|
131
139
|
requirements:
|
132
140
|
- - ! '>='
|
133
141
|
- !ruby/object:Gem::Version
|
134
142
|
version: '0'
|
143
|
+
- !ruby/object:Gem::Dependency
|
135
144
|
type: :development
|
136
|
-
prerelease: false
|
137
145
|
version_requirements: !ruby/object:Gem::Requirement
|
138
146
|
none: false
|
139
147
|
requirements:
|
140
148
|
- - ! '>='
|
141
149
|
- !ruby/object:Gem::Version
|
142
150
|
version: '0'
|
143
|
-
- !ruby/object:Gem::Dependency
|
144
151
|
name: capybara
|
152
|
+
prerelease: false
|
145
153
|
requirement: !ruby/object:Gem::Requirement
|
146
154
|
none: false
|
147
155
|
requirements:
|
148
156
|
- - ! '>='
|
149
157
|
- !ruby/object:Gem::Version
|
150
158
|
version: '0'
|
159
|
+
- !ruby/object:Gem::Dependency
|
151
160
|
type: :development
|
152
|
-
prerelease: false
|
153
161
|
version_requirements: !ruby/object:Gem::Requirement
|
154
162
|
none: false
|
155
163
|
requirements:
|
156
164
|
- - ! '>='
|
157
165
|
- !ruby/object:Gem::Version
|
158
166
|
version: '0'
|
159
|
-
- !ruby/object:Gem::Dependency
|
160
167
|
name: crypt-isaac
|
168
|
+
prerelease: false
|
161
169
|
requirement: !ruby/object:Gem::Requirement
|
162
170
|
none: false
|
163
171
|
requirements:
|
164
172
|
- - ! '>='
|
165
173
|
- !ruby/object:Gem::Version
|
166
174
|
version: '0'
|
175
|
+
- !ruby/object:Gem::Dependency
|
167
176
|
type: :development
|
168
|
-
prerelease: false
|
169
177
|
version_requirements: !ruby/object:Gem::Requirement
|
170
178
|
none: false
|
171
179
|
requirements:
|
172
180
|
- - ! '>='
|
173
181
|
- !ruby/object:Gem::Version
|
174
182
|
version: '0'
|
175
|
-
- !ruby/object:Gem::Dependency
|
176
183
|
name: launchy
|
184
|
+
prerelease: false
|
177
185
|
requirement: !ruby/object:Gem::Requirement
|
178
186
|
none: false
|
179
187
|
requirements:
|
180
188
|
- - ! '>='
|
181
189
|
- !ruby/object:Gem::Version
|
182
190
|
version: '0'
|
191
|
+
- !ruby/object:Gem::Dependency
|
183
192
|
type: :development
|
184
|
-
prerelease: false
|
185
193
|
version_requirements: !ruby/object:Gem::Requirement
|
186
194
|
none: false
|
187
195
|
requirements:
|
188
196
|
- - ! '>='
|
189
197
|
- !ruby/object:Gem::Version
|
190
198
|
version: '0'
|
191
|
-
- !ruby/object:Gem::Dependency
|
192
199
|
name: pry
|
193
|
-
requirement: !ruby/object:Gem::Requirement
|
194
|
-
none: false
|
195
|
-
requirements:
|
196
|
-
- - ! '>='
|
197
|
-
- !ruby/object:Gem::Version
|
198
|
-
version: '0'
|
199
|
-
type: :development
|
200
200
|
prerelease: false
|
201
|
-
|
201
|
+
requirement: !ruby/object:Gem::Requirement
|
202
202
|
none: false
|
203
203
|
requirements:
|
204
204
|
- - ! '>='
|
@@ -234,11 +234,11 @@ files:
|
|
234
234
|
- lib/devise_cas_authenticatable.rb
|
235
235
|
- lib/devise_cas_authenticatable/exceptions.rb
|
236
236
|
- lib/devise_cas_authenticatable/model.rb
|
237
|
+
- lib/devise_cas_authenticatable/railtie.rb
|
237
238
|
- lib/devise_cas_authenticatable/routes.rb
|
238
239
|
- lib/devise_cas_authenticatable/schema.rb
|
239
240
|
- lib/devise_cas_authenticatable/single_sign_out.rb
|
240
|
-
- lib/devise_cas_authenticatable/single_sign_out/
|
241
|
-
- lib/devise_cas_authenticatable/single_sign_out/session_store/redis.rb
|
241
|
+
- lib/devise_cas_authenticatable/single_sign_out/rack.rb
|
242
242
|
- lib/devise_cas_authenticatable/single_sign_out/strategies.rb
|
243
243
|
- lib/devise_cas_authenticatable/single_sign_out/strategies/base.rb
|
244
244
|
- lib/devise_cas_authenticatable/single_sign_out/strategies/rails_cache.rb
|
@@ -290,10 +290,10 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
290
290
|
requirements:
|
291
291
|
- - ! '>='
|
292
292
|
- !ruby/object:Gem::Version
|
293
|
-
version: '0'
|
294
293
|
segments:
|
295
294
|
- 0
|
296
|
-
hash: -
|
295
|
+
hash: -2741106234440343687
|
296
|
+
version: '0'
|
297
297
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
298
298
|
none: false
|
299
299
|
requirements:
|
@@ -1,12 +0,0 @@
|
|
1
|
-
ActiveRecord::SessionStore.class_eval do
|
2
|
-
|
3
|
-
include DeviseCasAuthenticatable::SingleSignOut::SetSession
|
4
|
-
alias_method_chain :set_session, :storage
|
5
|
-
|
6
|
-
#def destroy_session(env, session_id, options)
|
7
|
-
# if session = Session::find_by_session_id(sid)
|
8
|
-
# session.destroy
|
9
|
-
# end
|
10
|
-
#end
|
11
|
-
|
12
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
require "action_controller/session/redis_session_store"
|
2
|
-
|
3
|
-
module DeviseCasAuthenticatable
|
4
|
-
module SingleSignOut
|
5
|
-
module RedisSessionStore
|
6
|
-
|
7
|
-
include DeviseCasAuthenticatable::SingleSignOut::SetSession
|
8
|
-
|
9
|
-
def destroy_session(sid)
|
10
|
-
@pool.del(sid)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
|
17
|
-
if ::Redis::Store.rails3?
|
18
|
-
ActionDispatch::Session::RedisSessionStore.class_eval do
|
19
|
-
include DeviseCasAuthenticatable::SingleSignOut::RedisSessionStore
|
20
|
-
alias_method_chain :set_session, :storage
|
21
|
-
end
|
22
|
-
else
|
23
|
-
ActionController::Session::RedisSessionStore.class_eval do
|
24
|
-
include DeviseCasAuthenticatable::SingleSignOut::RedisSessionStore
|
25
|
-
alias_method_chain :set_session, :storage
|
26
|
-
end
|
27
|
-
end
|