thecore_backend_commons 3.1.6 → 3.1.7
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: e7d2992cb36afd3ab00a5000f8de7beda0733ee1f33ae20687b175c40af7ae85
|
|
4
|
+
data.tar.gz: '08edafe1ec3b07ac1a4aae5e5a4191da2dd94fc7b03044bc5a5424e35e2ccfe7'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
|
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
|