thecore_backend_commons 3.1.6 → 3.1.7

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: 83b2f5c0eff5f1608ffe2ba3190cd68f5f42620560983abdea7766063a68311f
4
- data.tar.gz: bcf1f5517c90726c0570597ddcc8571da335a896a4d67e06f89ac1f90fc5e04d
3
+ metadata.gz: e7d2992cb36afd3ab00a5000f8de7beda0733ee1f33ae20687b175c40af7ae85
4
+ data.tar.gz: '08edafe1ec3b07ac1a4aae5e5a4191da2dd94fc7b03044bc5a5424e35e2ccfe7'
5
5
  SHA512:
6
- metadata.gz: 2bf6a25d173c57e50a618b5609015ddfccf27ffad675d5c827a34150551c58c4c01ba6290783efc06a74a4d25a3b00d455b7bacc1ed614209f99e05cbfe03274
7
- data.tar.gz: 704ff1a0f14ba3d9721f8bd257077b4450154404d95f2007a835049d63dbb7a64db1a16c3f256a8f72daa878c39795b6918b4350d5d708c8773ce6f121f25ec4
6
+ metadata.gz: db4120e2f00cb752f1427025eafa8f54203d00a7f88d379f0526e6922f02cf042604402a107ffcaf180499e063949d8187225d8ba46381d4cce1a96b3d471c9f
7
+ data.tar.gz: f6cadb502eb009ab7f2e223350715fd6944d4bd5d66e7d33bcfe97eebb3664eb291981548a3f5cd252afb73b866ad236c32e7e3544431b575417146a2319ffb0
@@ -13,11 +13,11 @@ module CableConnectionConcern
13
13
 
14
14
  def find_verified_user
15
15
  # this checks whether a user is authenticated with devise
16
- # It looks for a token in the query parameters, or in the header
17
- m = request.query_parameters["token"].presence || request.headers["Authorization"].split(" ").second.strip
16
+ # It looks for a token in the query parameters, or in the headers
17
+ m = request.query_parameters["token"].presence || request.headers["Authorization"].split(" ").second.strip rescue nil
18
18
 
19
19
  body = ::HashWithIndifferentAccess.new(::JWT.decode(m, ::Rails.application.credentials.dig(:secret_key_base).presence||ENV["SECRET_KEY_BASE"], false)[0]) rescue nil
20
- if verified_user = (env['warden'].user.presence || User.find_by(id: body[:user_id]))
20
+ if verified_user = (env['warden'].user.presence || User.find_by(id: body[:user_id]) rescue false)
21
21
  verified_user
22
22
  else
23
23
  reject_unauthorized_connection
@@ -1,3 +1,3 @@
1
1
  module ThecoreBackendCommons
2
- VERSION = "3.1.6"
2
+ VERSION = "3.1.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thecore_backend_commons
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.6
4
+ version: 3.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriele Tassoni