rails_jwt_auth 2.0.0 → 2.0.1
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 +4 -4
- data/README.md +1 -1
- data/app/models/concerns/rails_jwt_auth/authenticatable.rb +2 -2
- data/lib/rails_jwt_auth.rb +1 -0
- data/lib/rails_jwt_auth/jwt_manager.rb +2 -0
- data/lib/rails_jwt_auth/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: c3ebe38a69058ce05f15ec6ffce2a2d91654a4839596f710d099d5bfa8098173
|
4
|
+
data.tar.gz: e565d1eaeec61e94456190e0839e7462bc5d2578d5059c7fda24ff8e1fbc3823
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3a2e4a93d66ac10a88cd45e6bcf50a2e21977ec4bd1fb1e71df9cc837dce910f401c5d0f8c61e851e3a41773b9e6b61555b1fd8aa23de0d915770f8d3e450f2
|
7
|
+
data.tar.gz: 4541e70821d3f2e104702012107d3ee10ca30a26e3e773aacca3af6327846cb4695dd4416cb619ab750e8976b63b001cbb93687f080dfce0ea6d73c3d01afdbd
|
data/README.md
CHANGED
@@ -363,7 +363,7 @@ It is necessary to set a value for `confirmations_url` option into `config/initi
|
|
363
363
|
|
364
364
|
### Password
|
365
365
|
|
366
|
-
|
366
|
+
Reset password api is defined by `RailsJwtAuth::ResetPasswordsController`.
|
367
367
|
|
368
368
|
1. Send reset password email (init reset password process):
|
369
369
|
|
@@ -8,7 +8,7 @@ module RailsJwtAuth
|
|
8
8
|
base.class_eval do
|
9
9
|
if defined?(Mongoid) && ancestors.include?(Mongoid::Document)
|
10
10
|
field :password_digest, type: String
|
11
|
-
field :auth_tokens, type: Array if RailsJwtAuth.simultaneous_sessions > 0
|
11
|
+
field :auth_tokens, type: Array, default: [] if RailsJwtAuth.simultaneous_sessions > 0
|
12
12
|
elsif defined?(ActiveRecord) && ancestors.include?(ActiveRecord::Base)
|
13
13
|
serialize :auth_tokens, Array
|
14
14
|
end
|
@@ -54,7 +54,7 @@ module RailsJwtAuth
|
|
54
54
|
|
55
55
|
def to_token_payload(_request=nil)
|
56
56
|
if RailsJwtAuth.simultaneous_sessions > 0
|
57
|
-
{auth_token: auth_tokens.last}
|
57
|
+
auth_tokens&.last ? {auth_token: auth_tokens.last} : false
|
58
58
|
else
|
59
59
|
{id: id.to_s}
|
60
60
|
end
|
data/lib/rails_jwt_auth.rb
CHANGED
@@ -9,6 +9,7 @@ module RailsJwtAuth
|
|
9
9
|
NotInvitationsUrl = Class.new(StandardError)
|
10
10
|
NotResetPasswordsUrl = Class.new(StandardError)
|
11
11
|
NotUnlockUrl = Class.new(StandardError)
|
12
|
+
InvalidJwtPayload = Class.new(StandardError)
|
12
13
|
|
13
14
|
mattr_accessor :model_name
|
14
15
|
self.model_name = 'User'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_jwt_auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- rjurado
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bcrypt
|