devise_masquerade 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of devise_masquerade might be problematic. Click here for more details.
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
Y2IwNTZiZjYzNWFkZDgxMWYyZTMzZmE2ZmI0M2FlZjZlN2ViMDk3ZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MTE4OGQ3MDc4ZTM0NjUzNzE5Njg4YWJmMmEyNTNmYWNhMzRhZDYxYg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YzE2MmNkMDc0NDIyYjk1ZGExMGFhYWNiMzEwYWQzMWY2OTE1Yjg2ODA0ZTY5
|
10
|
+
OTdjY2MyMWJmMmMyOGJkZDE5Y2I0ZDk1YmU1NWM0MTIzMjJjNzMwZDI3NmIw
|
11
|
+
NGY0ZmFmMjliNzAwYWM5MTFiZGE4MGI3YzUyOGE4NTA4ZDA3NmQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NjFjYzA4OTg2Y2FhOWUxNjUzODJlMjYyZTAxNzFiMTZhZTdmZmI4NDM2YjUz
|
14
|
+
OTAyMzQ3NzY2Y2Y0OWY2OTZiNTFiYTcxZjIwOWZkYmFmOGUwZTU0YjJjNGM2
|
15
|
+
NDMxOTk1NDkyYjc4ZjRhMjdiYTViNjAzMmU4NzZiODkxMWVmMDc=
|
data/README.md
CHANGED
@@ -11,6 +11,8 @@ class Devise::MasqueradesController < DeviseController
|
|
11
11
|
|
12
12
|
self.resource.masquerade!
|
13
13
|
|
14
|
+
sign_in(self.resource, :bypass => Devise.masquerade_bypass_warden_callback)
|
15
|
+
|
14
16
|
redirect_to("#{after_masquerade_path_for(self.resource)}?#{after_masquerade_param_for(resource)}")
|
15
17
|
end
|
16
18
|
|
@@ -12,31 +12,12 @@ describe Devise::MasqueradesController do
|
|
12
12
|
|
13
13
|
before do
|
14
14
|
SecureRandom.should_receive(:urlsafe_base64).and_return("secure_key")
|
15
|
-
|
16
15
|
get :show, :id => mask.to_param
|
17
16
|
end
|
18
17
|
|
19
18
|
it { session.keys.should include('devise_masquerade_user') }
|
19
|
+
it { session["warden.user.user.key"].first.first.should == mask.id }
|
20
20
|
it { should redirect_to("/?masquerade=secure_key") }
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
context 'when not logged in' do
|
25
|
-
before { get :show, :id => 'any_id' }
|
26
|
-
|
27
|
-
it { should redirect_to(new_user_session_path) }
|
28
|
-
end
|
29
|
-
|
30
|
-
describe 'back to the owner of the request' do
|
31
|
-
before { logged_in }
|
32
|
-
|
33
|
-
context 'and masquerade user' do
|
34
|
-
let(:mask) { create(:user) }
|
35
|
-
|
36
|
-
before do
|
37
|
-
SecureRandom.should_receive(:urlsafe_base64).and_return("secure_key")
|
38
|
-
get :show, :id => mask.to_param
|
39
|
-
end
|
40
21
|
|
41
22
|
context 'and back' do
|
42
23
|
before { get :back }
|
@@ -47,6 +28,12 @@ describe Devise::MasqueradesController do
|
|
47
28
|
end
|
48
29
|
end
|
49
30
|
end
|
31
|
+
|
32
|
+
context 'when not logged in' do
|
33
|
+
before { get :show, :id => 'any_id' }
|
34
|
+
|
35
|
+
it { should redirect_to(new_user_session_path) }
|
36
|
+
end
|
50
37
|
end
|
51
38
|
|
52
39
|
# it's a page with masquerade button ("Login As")
|
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: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexandr Korsak
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|