thecore_ui_rails_admin 3.0.7 → 3.0.9

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: c92dfa0ea94b25f9ddbe39304a0c10fdb716c6d4ef271353f4c84c293b1d2d6b
4
- data.tar.gz: 0d159f770d6078ca44c6a87c479ac9a4f5e991827cf3c720f2241b4685c558ac
3
+ metadata.gz: bb00da1db8502b80a343d307bac474a1384f2bd2e48b171794931227fd89b907
4
+ data.tar.gz: 8e95d44ff179514d817333c8e1e4383ee6dad3a6914b25b5940c3e66284033ac
5
5
  SHA512:
6
- metadata.gz: 0b2f5b78a265e357b2d0f5a5a114e3880e9ec49fb8ee3ee89b83c43b49395722dfe022a7bfe600282624cc1bd209eef1a4330720729144da4a8f4728388d9d47
7
- data.tar.gz: '095446452ed01a2ae2ade63d087ef86fa826fb9fcab71cd18f5cbe09ce4e0bdc2d8dcbd74817e4aa2509e2ecac8607f17c4d61f2b012c953db946e50308cb1c1'
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 do
13
- warden.authenticate! scope: :user
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 ==
@@ -49,7 +48,7 @@ Rails.application.configure do
49
48
  end
50
49
 
51
50
  # include the extension
52
- ApplicationController.send(:include, ThecoreUiRailsAdminActionControllerConcern)
51
+ ActionController::Base.send(:include, ThecoreUiRailsAdminActionControllerConcern)
53
52
  RailsAdmin::Config::Actions::Export.send(:include, ExportConcern)
54
53
  RailsAdmin::Config::Actions::BulkDelete.send(:include, BulkDeleteConcern)
55
54
  Role.send :include, ThecoreUiRailsAdminRoleConcern
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thecore_ui_rails_admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.7
4
+ version: 3.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriele Tassoni