devise_masquerade 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

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
- MDc3NTliYzA3MGM1MDc5NjM1NmJlYjEyOTY2NzhiNmUyMTI2NTdlYQ==
4
+ YWUwMmRiNWY4ZmNjYzVhYjg5N2ZiMGFhMzY3NzM0NDIyNGU4MGM3Mw==
5
5
  data.tar.gz: !binary |-
6
- Mjc1YTJhOTI3MzQ2ZTJjYzM1ZDhhMTEyMDQ2Y2UyN2I5YjIzNWQ3Zg==
6
+ ZjhlYWI5NWEyYzU3ZjVmNmIzOTA5ZmJjYjY0MjBhYjRlMTg3YTZjZA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YTdhYjlmMTE0YzYxYzJmMWQxOGVjNDY1NWRlZTdmZGFlNWY2Yjk4NzlkZmNl
10
- YzM3MTQyNGJlY2RiZjFiMTMxZjk1ZThhZDQ0NzQ2MTA1NDZjMmRkNGMyY2Ji
11
- MGVjZDdmMzFjNTY5MjJkNjQzNzkyNGFiZjE0NGRmNDQ5YzU2Yjc=
9
+ MWM4M2FhYTE4ODhiMTFmZjg4NzA3MDA4OTMzMjE2MTIxN2U3YTljMmM3NGZk
10
+ NDljMTAyMmQ2ZGJlYmI3Mjk5ODNjZjZhZWMzMjQ3ZTYwMWQ5MjVmM2UyYmZl
11
+ NTgyMjkxNDE5ZGViZDZkMmFmNjYzM2IzMmU0OTYxZGQ5Y2FjNWU=
12
12
  data.tar.gz: !binary |-
13
- YTFhN2JlMjRkNDJjZTNkNDFiMmE2MTU5MjYyNDY1NjU5Y2IwZWNlNDkzZmU1
14
- ZDQxNWNlZTNkY2ZiMTI5YWNjZTVlYjYwMGM2MTE0ZTVjYWQzNTA5MmQzZTc1
15
- NTZjMmFmMTVkYTQxYzlmNzY1MjQxYjBmM2E5ZjMxMjhkYTU1Y2M=
13
+ ZjU4Y2UyYjc5ODRlOWU4ZTBhMjM4MWVlZWRkMzcxNDAxZDZmNjA2OWQxNzNl
14
+ NDU3MzExZmU2YTI4ZGMzMmUyN2Q1MmM1MzJmMDhmZTkwNjhkZjA0Zjc2ZDY1
15
+ ZTExMDM3NTE0Mjg1ODA3MzY5NjZhMjZhYzgxYjlhZWRkMGQwMTg=
data/README.md CHANGED
@@ -79,6 +79,7 @@ helpers:
79
79
  Devise.masquerade_param = 'masquerade'
80
80
  Devise.masquerade_expires_in = 10.seconds
81
81
  Devise.masquerade_key_size = 16 # size of the generate by SecureRandom.urlsafe_base64
82
+ Devise.masquerade_bypass_warden_callback = false
82
83
 
83
84
  ## Demo project
84
85
 
@@ -17,7 +17,7 @@ class Devise::MasqueradesController < DeviseController
17
17
  def back
18
18
  owner_user = resource_class.to_adapter.find_first(:id => session[session_key])
19
19
 
20
- sign_in owner_user
20
+ sign_in(owner_user, :bypass => Devise.masquerade_bypass_warden_callback)
21
21
 
22
22
  redirect_to after_back_masquerade_path_for(owner_user)
23
23
  end
@@ -10,7 +10,7 @@ module DeviseMasquerade
10
10
 
11
11
  #{name} = #{name.to_s.classify}.find_by_masquerade_key(params[:masquerade])
12
12
 
13
- sign_in #{name} if #{name}
13
+ sign_in(#{name}, :bypass => Devise.masquerade_bypass_warden_callback) if #{name}
14
14
  end
15
15
 
16
16
  def #{name}_masquerade?
@@ -1,3 +1,3 @@
1
1
  module DeviseMasquerade
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -21,6 +21,9 @@ module Devise
21
21
  mattr_accessor :masquerade_key_size
22
22
  @@masquerade_key_size = 16
23
23
 
24
+ mattr_accessor :masquerade_bypass_warden_callback
25
+ @@masquerade_bypass_warden_callback = false
26
+
24
27
  @@helpers << DeviseMasquerade::Controllers::Helpers
25
28
  end
26
29
 
@@ -2,7 +2,7 @@ module Authentication
2
2
  def logged_in
3
3
  @user ||= create(:user)
4
4
 
5
- sign_in @user
5
+ sign_in(@user, :bypass => Devise.masquerade_bypass_warden_callback)
6
6
  end
7
7
 
8
8
  def current_user
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise_masquerade
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexandr Korsak