thecore_ui_rails_admin 3.0.8 → 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: 1b1d473b867c0b14de78c2a34c30266e3505bf91a688dfd598c5ae8e6c9ad5de
4
- data.tar.gz: 0e7ae5b16823c99c76509f5ee045525398ad7d82dbf86542fea2d33a95ab198e
3
+ metadata.gz: bb00da1db8502b80a343d307bac474a1384f2bd2e48b171794931227fd89b907
4
+ data.tar.gz: 8e95d44ff179514d817333c8e1e4383ee6dad3a6914b25b5940c3e66284033ac
5
5
  SHA512:
6
- metadata.gz: 0f90902ea13df6f79cfa1197635bb2224dbcd64b656979fe2256de6731e920f04abd6aa256278001ea2f0822c641a49b62608c719d28f7e6e55c105e6f333537
7
- data.tar.gz: fea3308bb6c152a4293868a38bdb5581a74476e3e1c96fb8c0c764401859f093e1a1e2d6727674ef5f7f999d3bf3287f423c851a6c34d88b7472c4c9ef25145b
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 ==
@@ -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.8
4
+ version: 3.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriele Tassoni