avo 3.30.2 → 3.30.3
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/app/components/avo/referrer_params_component.html.erb +1 -1
- data/app/components/avo/views/resource_show_component.rb +1 -1
- data/app/controllers/avo/base_application_controller.rb +0 -1
- data/app/controllers/avo/base_controller.rb +3 -1
- data/app/helpers/avo/application_helper.rb +5 -3
- data/lib/avo/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cd6222805c1fb419248e68b029cd5b9dec91b0d2faccf403d6f1ad39ce2a96f2
|
|
4
|
+
data.tar.gz: fa3ff35952311e35121b928d89dbc9c9d7e613ee96465b83a1c106ad9c2eb342
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f47c3579be975550a03d97c5451d9a3911ecc71ba473a9e8b9897ffd6130d5e0e694ffe7f68573c58fe4a56da267cb58e7230f44f5fa5c5fa5b39b19e6e0cbcf
|
|
7
|
+
data.tar.gz: a9b8729b81e5d8487738aa22c2298ae3e809089892e4116f1c23b25cfc52941a2207619a21c6f70db64741a682641f46ba9792dfa10769a2de3edc576a6c3823
|
data/Gemfile.lock
CHANGED
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
<%= hidden_field_tag :via_record_id, params[:via_record_id] if params[:via_record_id] %>
|
|
5
5
|
<%= hidden_field_tag :via_relation, params[:via_relation] if params[:via_relation] %>
|
|
6
6
|
<%= hidden_field_tag :via_belongs_to_resource_class, params[:via_belongs_to_resource_class] if params[:via_belongs_to_resource_class] %>
|
|
7
|
-
<%= hidden_field_tag :return_to, params[:return_to] if params[:return_to].present? %>
|
|
7
|
+
<%= hidden_field_tag :return_to, e(params[:return_to]) if params[:return_to].present? %>
|
|
8
8
|
<%= hidden_field_tag :referrer, @back_path if params[:via_resource_class] %>
|
|
@@ -57,7 +57,7 @@ class Avo::Views::ResourceShowComponent < Avo::ResourceComponent
|
|
|
57
57
|
# When coming from a turbo frame, we don't want to return to that exact frame
|
|
58
58
|
# for example when editing a has_one field we want to return to the parent frame
|
|
59
59
|
# not the frame of the has_one field.
|
|
60
|
-
args[:return_to] = request.
|
|
60
|
+
args[:return_to] = e(request.fullpath) unless request.url.include?("turbo_frame=")
|
|
61
61
|
|
|
62
62
|
helpers.edit_resource_path(record: @resource.record, resource: @resource, **args)
|
|
63
63
|
end
|
|
@@ -546,7 +546,9 @@ module Avo
|
|
|
546
546
|
return nil if @resource.class.send(action).blank?
|
|
547
547
|
|
|
548
548
|
extra_args = {}
|
|
549
|
-
|
|
549
|
+
if params[:return_to].present?
|
|
550
|
+
extra_args[:return_to] = e(params[:return_to])
|
|
551
|
+
end
|
|
550
552
|
|
|
551
553
|
if @resource.class.send(action) == :index
|
|
552
554
|
resources_path(resource: @resource, **extra_args)
|
|
@@ -161,14 +161,16 @@ module Avo
|
|
|
161
161
|
|
|
162
162
|
# encode & encrypt params
|
|
163
163
|
def e(value)
|
|
164
|
-
Avo::Services::EncryptionService.encrypt(message: value, purpose: :return_to, serializer: Marshal)
|
|
164
|
+
encrypted = Avo::Services::EncryptionService.encrypt(message: value, purpose: :return_to, serializer: Marshal)
|
|
165
|
+
Base64.urlsafe_encode64(encrypted, padding: false)
|
|
165
166
|
end
|
|
166
167
|
|
|
167
168
|
# decrypt & decode params
|
|
168
169
|
def d(value)
|
|
169
|
-
|
|
170
|
+
decoded = Base64.urlsafe_decode64(value.to_s)
|
|
171
|
+
Avo::Services::EncryptionService.decrypt(message: decoded, purpose: :return_to, serializer: Marshal)
|
|
170
172
|
rescue
|
|
171
|
-
|
|
173
|
+
nil
|
|
172
174
|
end
|
|
173
175
|
|
|
174
176
|
private
|
data/lib/avo/version.rb
CHANGED