thecore_ui_rails_admin 3.0.8 → 3.0.9
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb00da1db8502b80a343d307bac474a1384f2bd2e48b171794931227fd89b907
|
4
|
+
data.tar.gz: 8e95d44ff179514d817333c8e1e4383ee6dad3a6914b25b5940c3e66284033ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6d8ec9b9279dfeab789ded2e7c275ab04159385ff00872f818b1bd47d6330ef4adf71b5c520c9389da850ed074d9220d85b3bad1773ba49d1640f98dde95ca6
|
7
|
+
data.tar.gz: 3208deb20e1c0afb284b761098187fc9f3a7ce854f2b98d1c3dc23878486ebc6180d59c07ee7658f81f0802b63057d6ca920172694b910fa7a1228f67c224b02
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Rails.application.configure do
|
2
2
|
config.after_initialize do
|
3
3
|
# Freeze more or fewer columns (col 1 = checkboxes, 2 = links/actions) for horizontal scrolling:
|
4
|
-
RailsAdmin::Config.sidescroll = {num_frozen_columns: 2}
|
4
|
+
RailsAdmin::Config.sidescroll = { num_frozen_columns: 2 }
|
5
5
|
|
6
6
|
RailsAdmin::Config.main_app_name = Proc.new { |controller| [ ((ENV["APP_NAME"].presence || Settings.app_name.presence) rescue "Thecore"), "" ] }
|
7
7
|
# Link for background Job
|
@@ -9,9 +9,8 @@ Rails.application.configure do
|
|
9
9
|
|
10
10
|
### Popular gems integration
|
11
11
|
## == Devise ==
|
12
|
-
RailsAdmin::Config.authenticate_with
|
13
|
-
|
14
|
-
end
|
12
|
+
RailsAdmin::Config.authenticate_with { warden.authenticate! scope: :user }
|
13
|
+
|
15
14
|
RailsAdmin::Config.current_user_method(&:current_user)
|
16
15
|
|
17
16
|
## == Cancan ==
|
@@ -7,15 +7,17 @@ module ThecoreUiRailsAdminActionControllerConcern
|
|
7
7
|
# Prevent CSRF attacks by raising an exception.
|
8
8
|
# For APIs, you may want to use :null_session instead.
|
9
9
|
# layout 'thecore'
|
10
|
-
puts "Protecting from Forgery with exception and prepend"
|
11
|
-
protect_from_forgery with: :exception, prepend: true
|
12
|
-
rescue_from CanCan::AccessDenied do |exception|
|
13
|
-
redirect_to main_app.root_url, alert: exception.message
|
10
|
+
puts "Protecting from Forgery with exception and prepend #{ENV["SECRET_KEY_BASE"]}"
|
11
|
+
protect_from_forgery with: :exception, prepend: true, except: :sign_in
|
12
|
+
rescue_from CanCan::AccessDenied do |exception|
|
13
|
+
redirect_to main_app.root_url, alert: exception.message
|
14
14
|
end
|
15
|
+
|
15
16
|
include HttpAcceptLanguage::AutoLocale
|
16
17
|
before_action :store_user_location!, if: :storable_location?
|
17
18
|
before_action :configure_permitted_parameters, if: :devise_controller?
|
18
19
|
before_action :reject_locked!, if: :devise_controller?
|
20
|
+
before_action :debug_csrf
|
19
21
|
|
20
22
|
helper_method :reject_locked!
|
21
23
|
helper_method :require_admin!
|
@@ -146,4 +148,9 @@ module ThecoreUiRailsAdminActionControllerConcern
|
|
146
148
|
def is_storable?
|
147
149
|
true
|
148
150
|
end
|
151
|
+
|
152
|
+
def debug_csrf
|
153
|
+
puts "CSRF: #{params["authenticity_token"]}"
|
154
|
+
puts "Authenticity Token #{ENV["SECRET_KEY_BASE"]}"
|
155
|
+
end
|
149
156
|
end
|