ntq_tools 0.5.2 → 0.6.0

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: 31adc13868bf234dece4f45a91e3f163ef8c9a72fe433a67e890d34efce043e2
4
- data.tar.gz: b88556d68a75735690128006616bb37e30fec9ae3bbdf39640a3b90b1281d616
3
+ metadata.gz: '019d7dc36a586c41c90f0344dc403b659636885801160c02ce727bce64a67c02'
4
+ data.tar.gz: c428933a52c6da37c406d6b7d67506c653144c8db7b0256c7a0ac5979f784a5f
5
5
  SHA512:
6
- metadata.gz: 5810e19e2b39d8002f5281d242d6dac226fdb20b3b5ad48fb01c51108ee3ea77fdcaf7ee3d6dd5e4431853941f876723e0f95877374937f0d1adc97b380ae17b
7
- data.tar.gz: c7183009c3c6d2bbe3a784c2bdf13bbb71524a4b6824c29117e2e82c5492fd9f13bb20b0a6731228f5ed7ec7702f6f38a47855936d154fea87b43f4583bc1706
6
+ metadata.gz: 16a33bdd9c21bb5c83f4f3b82bc983f8072ce75bf31a144c1056fc364e6a10e03392055e1d4c44c85e6690c5993c6f00e7bd52e7fb028577c1d99fefe22388ef
7
+ data.tar.gz: d52ae223a99923e7c85c47d240d81b65f222c2be988aa044b7c0336c12345206382b1ae961a22fa3b9dd4a8010105fe66cf632232816150bdf2a63bf36716c31
@@ -1,6 +1,9 @@
1
1
  module NtqTools
2
2
  class ImpersonationController < ::ApplicationController
3
-
3
+ skip_before_action :authenticate_user!, raise: false, if: -> { Rails.env.development? }
4
+ skip_before_action :authenticate_back_user!, raise: false, if: -> { Rails.env.development? }
5
+ skip_before_action :authenticate_customer!, raise: false, if: -> { Rails.env.development? }
6
+
4
7
  before_action :check_impersonation_enabled, except: [:config]
5
8
  before_action :model_name_is_valid?, only: [:sign_in]
6
9
 
@@ -5,8 +5,8 @@ module NtqTools
5
5
  before_action :check_presence_of_key, except: [:refresh]
6
6
 
7
7
  def show
8
- return render json: { data: nil }, status: 404 unless I18n.exists?(params[:key].to_s)
9
-
8
+ return render json: { data: nil }, status: 404 unless I18n.exists?(params[:key].to_s)
9
+
10
10
  render json: {
11
11
  data: I18n.t(params[:key])
12
12
  }, status: 200
data/config/routes.rb CHANGED
@@ -2,7 +2,7 @@ NtqTools::Engine.routes.draw do
2
2
  resource :translation, only: [:update, :show]
3
3
  get '/translation/refresh' => "translations#refresh"
4
4
 
5
- if NtqTools.impersonation_enabled && NtqTools.impersonation_user_models.any? && defined?(Devise)
5
+ if NtqTools.impersonation_enabled && NtqTools.impersonation_user_models.any? && defined?(Devise) && Rails.env.development?
6
6
  get '/impersonation/users' => "impersonation#index"
7
7
  get "/impersonation/:model_name/:id/sign_in" => "impersonation#signin"
8
8
  end
@@ -1,3 +1,3 @@
1
1
  module NtqTools
2
- VERSION = "0.5.2"
2
+ VERSION = "0.6.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ntq_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-19 00:00:00.000000000 Z
11
+ date: 2023-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails