thecore_backend_commons 3.1.5 → 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: 97741971ca6bd986ce48c1237ce588165731d323c11aa445db719d54bfc456b8
4
- data.tar.gz: f2ca229b0010a509c2f1519588625f4a5873f7f949a732c701fe91a156667628
3
+ metadata.gz: e7d2992cb36afd3ab00a5000f8de7beda0733ee1f33ae20687b175c40af7ae85
4
+ data.tar.gz: '08edafe1ec3b07ac1a4aae5e5a4191da2dd94fc7b03044bc5a5424e35e2ccfe7'
5
5
  SHA512:
6
- metadata.gz: 4a3e601c21af2052e7c5399a8a3ce07c20e4e1b02b3163a81f91aa92c196288a619627e13ac9d4b2a1762283472e78fa1ae7334e168dae12eb3360e7d7b0a94d
7
- data.tar.gz: '0709885ccaf4e4347f314e6599ca42f8da0ad982e9bb229c3d44dae3d4d29bc066ec4a3f4f190ce4c965e9906fbc93a0acf6d6dee95b37059edd57368e0c354f'
6
+ metadata.gz: db4120e2f00cb752f1427025eafa8f54203d00a7f88d379f0526e6922f02cf042604402a107ffcaf180499e063949d8187225d8ba46381d4cce1a96b3d471c9f
7
+ data.tar.gz: f6cadb502eb009ab7f2e223350715fd6944d4bd5d66e7d33bcfe97eebb3664eb291981548a3f5cd252afb73b866ad236c32e7e3544431b575417146a2319ffb0
data/README.md CHANGED
@@ -1,28 +1 @@
1
- # ThecoreBackendCommons
2
- Short description and motivation.
3
-
4
- ## Usage
5
- How to use my plugin.
6
-
7
- ## Installation
8
- Add this line to your application's Gemfile:
9
-
10
- ```ruby
11
- gem "thecore_backend_commons"
12
- ```
13
-
14
- And then execute:
15
- ```bash
16
- $ bundle
17
- ```
18
-
19
- Or install it yourself as:
20
- ```bash
21
- $ gem install thecore_backend_commons
22
- ```
23
-
24
- ## Contributing
25
- Contribution directions go here.
26
-
27
- ## License
28
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
1
+ This is part of Thecore framework: https://github.com/gabrieletassoni/thecore/tree/release/3
@@ -11,11 +11,13 @@ module CableConnectionConcern
11
11
 
12
12
  protected
13
13
 
14
- def find_verified_user # this checks whether a user is authenticated with devise
15
- m = request.query_parameters["token"]
14
+ def find_verified_user
15
+ # this checks whether a user is authenticated with devise
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
16
18
 
17
19
  body = ::HashWithIndifferentAccess.new(::JWT.decode(m, ::Rails.application.credentials.dig(:secret_key_base).presence||ENV["SECRET_KEY_BASE"], false)[0]) rescue nil
18
- 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)
19
21
  verified_user
20
22
  else
21
23
  reject_unauthorized_connection
@@ -1,3 +1,3 @@
1
1
  module ThecoreBackendCommons
2
- VERSION = "3.1.5"
2
+ VERSION = "3.1.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thecore_backend_commons
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.5
4
+ version: 3.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriele Tassoni
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-13 00:00:00.000000000 Z
11
+ date: 2023-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thecore_auth_commons