thecore_backend_commons 3.1.5 → 3.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -28
- data/config/initializers/concern_cable_connection.rb +5 -3
- data/lib/thecore_backend_commons/version.rb +1 -1
- metadata +2 -2
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
|
data/README.md
CHANGED
@@ -1,28 +1 @@
|
|
1
|
-
|
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
|
15
|
-
|
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
|
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.
|
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-
|
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
|