devise_masquerade 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/app/controllers/devise/masquerades_controller.rb +10 -8
- data/lib/devise_masquerade/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e7178dc0f54d070a2f4e839f320f65c5506b215a902cc2180b8e357d1a9f62d
|
4
|
+
data.tar.gz: 5466190dbaae779ca45abaa8e65f526e1b99805a493019c8dc67572d387b8022
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2b85a5241c5aef644ca6139f89807631b6e93ebcbc2fc77f0b88f74e43bd411a056bb49c3340ae63322e22cf13a5ca4185208d7c8c778e124d04fa37bb19cbd
|
7
|
+
data.tar.gz: 374dacc212988505fca5cfea9188a7fcdce44d174b54b3cd980363b37c377bb92713ab8467858eefa62d23568783e09929bcdace08efa344bf5610f382e32f31
|
data/Gemfile.lock
CHANGED
@@ -77,13 +77,15 @@ class Devise::MasqueradesController < DeviseController
|
|
77
77
|
def find_owner_resource(masqueradable_resource)
|
78
78
|
skey = session_key(masqueradable_resource, masquerading_guid)
|
79
79
|
|
80
|
-
|
81
|
-
session[skey]
|
80
|
+
if Devise.masquerade_storage_method_session?
|
81
|
+
resource_id = session[skey]
|
82
|
+
|
83
|
+
masqueraded_resource_class.find(resource_id)
|
82
84
|
else
|
83
|
-
Rails.cache.read(skey)
|
84
|
-
end
|
85
|
+
data = Rails.cache.read(skey)
|
85
86
|
|
86
|
-
|
87
|
+
GlobalID::Locator.locate_signed(data, for: 'masquerade')
|
88
|
+
end
|
87
89
|
end
|
88
90
|
|
89
91
|
def go_back(user, path:)
|
@@ -161,13 +163,13 @@ class Devise::MasqueradesController < DeviseController
|
|
161
163
|
|
162
164
|
skey = session_key(masqueradable_resource, guid)
|
163
165
|
|
164
|
-
|
166
|
+
resource_obj = send("current_#{masquerading_resource_name}")
|
165
167
|
|
166
168
|
if Devise.masquerade_storage_method_session?
|
167
|
-
session[skey] =
|
169
|
+
session[skey] = resource_obj.to_param
|
168
170
|
else
|
169
171
|
# skip sharing owner id via session
|
170
|
-
Rails.cache.write(skey,
|
172
|
+
Rails.cache.write(skey, resource_obj.to_sgid(for: 'masquerade'))
|
171
173
|
|
172
174
|
session[skey] = true
|
173
175
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devise_masquerade
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexandr Korsak
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-10-
|
11
|
+
date: 2022-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|