devise_masquerade 1.3.1 → 1.3.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23f626ba1c590f1686660a00804eaa5c5139a210fae80e72168a9f0a322e4be8
|
4
|
+
data.tar.gz: ee1641f8fed338ac83be5935b5e374df60fc7eb003919c120b24052528462302
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49c892cf2302d56d3d3aafb106d4e2eeba92b6c2f256440aa27a428df620bd16f49e89d5666ef6c2083e44fb260c1cb0beef3e575234cf5c6e91bff8f621dc4d
|
7
|
+
data.tar.gz: 357d959e456fa0d10a748f2c15b4cd0f94f8c21e773c970d52715e752dfd29c4d39f1e5f06fb2cbe11c8b4517c9503203954af1674a4a02c89669ffacbacc5c0
|
data/Gemfile.lock
CHANGED
@@ -6,7 +6,8 @@ class Devise::MasqueradesController < DeviseController
|
|
6
6
|
end
|
7
7
|
skip_before_action :masquerade!, raise: false
|
8
8
|
|
9
|
-
prepend_before_action :authenticate_scope!, :
|
9
|
+
prepend_before_action :authenticate_scope!, only: :show
|
10
|
+
prepend_before_action :masquerade_authorize!
|
10
11
|
|
11
12
|
before_action :save_masquerade_owner_session, only: :show
|
12
13
|
|
@@ -15,6 +16,10 @@ class Devise::MasqueradesController < DeviseController
|
|
15
16
|
def show
|
16
17
|
self.resource = find_resource
|
17
18
|
|
19
|
+
if resource.class != masquerading_resource_class
|
20
|
+
sign_out(send("current_#{masquerading_resource_name}"))
|
21
|
+
end
|
22
|
+
|
18
23
|
unless resource
|
19
24
|
flash[:error] = "#{masqueraded_resource_class} not found."
|
20
25
|
redirect_to(new_user_session_path) and return
|
@@ -28,6 +33,10 @@ class Devise::MasqueradesController < DeviseController
|
|
28
33
|
end
|
29
34
|
|
30
35
|
def back
|
36
|
+
unless send("#{masqueraded_resource_name}_signed_in?")
|
37
|
+
head(401) and return
|
38
|
+
end
|
39
|
+
|
31
40
|
self.resource = find_owner_resource
|
32
41
|
|
33
42
|
if resource.class != masqueraded_resource_class
|
@@ -43,7 +43,7 @@ module DeviseMasquerade
|
|
43
43
|
|
44
44
|
def #{name}_masquerade_owner
|
45
45
|
return nil unless send(:#{name}_masquerade?)
|
46
|
-
GlobalID::Locator.locate_signed(Rails.cache.read(:"devise_masquerade_#{name}"), for: 'masquerade')
|
46
|
+
GlobalID::Locator.locate_signed(::Rails.cache.read(:"devise_masquerade_#{name}"), for: 'masquerade')
|
47
47
|
end
|
48
48
|
|
49
49
|
private
|
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: 1.3.
|
4
|
+
version: 1.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexandr Korsak
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-02-
|
11
|
+
date: 2021-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|