devise_masquerade 1.3.1 → 1.3.2
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: 7b817222d25ead9ef77e2075ab3d2f86693659fea00373b9cd998c8dfc81becb
|
4
|
+
data.tar.gz: 7d95e96a4ed3f3c6addcb54fcab39fe0df54d6eeaf513e0d363035b61d1da46e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dcec6dae97ed366a03553c6762f4d042a256aed0765aec2fe39c64ea93ecf1f4593eb60e7d57555fc399b0f4ae818f6883e80b11974b0a88c17bdfb18831cc0d
|
7
|
+
data.tar.gz: 6814d659d4cb22cb9b88aacd55d0ca3a54c208248919b389174cb220d4bf856682fe6cfd3ce287ec03bdc9554baec3e3556d7b44c92139138daaf3467b44b682
|
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
|
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.2
|
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-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|