effective_resources 2.19.6 → 2.19.7

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: 571ebcdbbca75cd1b0937bc814229321b1682f336f729517689b9ae594aa9758
4
- data.tar.gz: 1b606b2566f0f1eb5ef9a2d5764df5ce1606aa25f8c8f6144a84f14978624479
3
+ metadata.gz: 755f35cecf11e51a68cc1a998a6f14ffcb60fc7f790b19989c569d7015f7082a
4
+ data.tar.gz: 28c81ad69b69c2ded6d458fde80921453777745d58d5828c81b411add7e3ac76
5
5
  SHA512:
6
- metadata.gz: 634a2b8f2ca6a4d8a311b347365a16bd60bc9a2f2d2c99400cef5e96c61acfe4907befa97f74b0857d1deed9cdc73c6e2b639368870ff7d1816ec27460961807
7
- data.tar.gz: c40344256152ca4a273dce2c580d3d0703d08fd79e4e0283d4112bc02a63bbb584e717ad8e5785ad23b43ee862b3374b84f9c0542c3160cfe0c2f8fa7b6a0d91
6
+ metadata.gz: f734ba1bb834a8337d0ca537db43576f8290ed067653405394a8784110e137f10d885436c706c368452265282d78932cfa7824dff2b1f7f196298c06fc29ac0a
7
+ data.tar.gz: dee4966d4485ccfac7daecc4afb41cc77571d696298c5f075334de9b27b6ec11496f361ecee3528335801a3b81a09d8172b941bf3c403dda958118629693baa6
@@ -3,13 +3,19 @@ module Effective
3
3
  module Destroy
4
4
 
5
5
  def destroy
6
- @user = current_user.class.find(session[:impersonation_user_id])
7
- redirect_path = after_destroy_impersonate_path_for(@user)
8
-
9
6
  # Reset impersonation
10
7
  session[:impersonation_user_id] = nil
11
8
  session[:impersonation_original_path] = nil
12
9
 
10
+ # Edge case where the current_user is blank. Weird session data.
11
+ if current_user.blank?
12
+ redirect_to(root_path) and return
13
+ end
14
+
15
+ # The current_user exists
16
+ @user = current_user.class.find(session[:impersonation_user_id])
17
+ redirect_path = after_destroy_impersonate_path_for(@user)
18
+
13
19
  expire_data_after_sign_in!
14
20
  warden.session_serializer.store(@user, Devise::Mapping.find_scope!(@user))
15
21
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveResources
2
- VERSION = '2.19.6'.freeze
2
+ VERSION = '2.19.7'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_resources
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.19.6
4
+ version: 2.19.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-02 00:00:00.000000000 Z
11
+ date: 2024-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails