rails_jwt_auth 0.13.0 → 0.14.0
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 -0
- data/app/models/concerns/rails_jwt_auth/confirmable.rb +7 -1
- data/app/models/concerns/rails_jwt_auth/recoverable.rb +7 -1
- data/lib/generators/templates/initializer.rb +3 -0
- data/lib/rails_jwt_auth.rb +3 -0
- data/lib/rails_jwt_auth/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 84bbab8a21df1dc0ab2aa4f1a4b3cf6bcdeeb300
|
4
|
+
data.tar.gz: 8c70773e3fa6760e87060c6d7540e733ae4b964f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9a59be18b4bb7579f66ff79c1beae53ea8b125ed8a7b521d587113535491e6151a83ba4469306bab5b3a093edd83b1b3dbf2dbe54a2103cf689d15bc276da56
|
7
|
+
data.tar.gz: 6a4617b02cae8cc664eafbc08e315dcbd7cc6b171bd2013cda4266f5a1df6cbd47d783b415bf9f815843e0e82edfdd426f55c473a5d6346d8add9567cb86e5b9
|
data/README.md
CHANGED
@@ -45,6 +45,7 @@ You can edit configuration options into `config/initializers/auth_token_auth.rb`
|
|
45
45
|
| confirmation_expiration_time | 1.day | Confirmation token expiration time |
|
46
46
|
| reset_password_url | password_path | Url used to create email link with reset password token |
|
47
47
|
| reset_password_expiration_time | 1.day | Confirmation token expiration time |
|
48
|
+
| deliver_later | false | Uses `deliver_later` method to send emails |
|
48
49
|
|
49
50
|
## Authenticatable
|
50
51
|
|
@@ -8,8 +8,10 @@ module RailsJwtAuth
|
|
8
8
|
|
9
9
|
self.confirmation_token = SecureRandom.base58(24)
|
10
10
|
self.confirmation_sent_at = Time.now
|
11
|
+
return false unless save
|
11
12
|
|
12
|
-
Mailer.confirmation_instructions(self)
|
13
|
+
mailer = Mailer.confirmation_instructions(self)
|
14
|
+
RailsJwtAuth.deliver_later ? mailer.deliver_later : mailer.deliver
|
13
15
|
end
|
14
16
|
|
15
17
|
def confirmed?
|
@@ -38,6 +40,10 @@ module RailsJwtAuth
|
|
38
40
|
|
39
41
|
def self.included(base)
|
40
42
|
if base.ancestors.include? Mongoid::Document
|
43
|
+
# include GlobalID::Identification to use deliver_later method
|
44
|
+
# http://edgeguides.rubyonrails.org/active_job_basics.html#globalid
|
45
|
+
base.send(:include, GlobalID::Identification) if RailsJwtAuth.deliver_later
|
46
|
+
|
41
47
|
base.send(:field, :email, type: String)
|
42
48
|
base.send(:field, :unconfirmed_email, type: String)
|
43
49
|
base.send(:field, :confirmation_token, type: String)
|
@@ -8,8 +8,10 @@ module RailsJwtAuth
|
|
8
8
|
|
9
9
|
self.reset_password_token = SecureRandom.base58(24)
|
10
10
|
self.reset_password_sent_at = Time.now
|
11
|
+
return false unless save
|
11
12
|
|
12
|
-
Mailer.reset_password_instructions(self)
|
13
|
+
mailer = Mailer.reset_password_instructions(self)
|
14
|
+
RailsJwtAuth.deliver_later ? mailer.deliver_later : mailer.deliver
|
13
15
|
end
|
14
16
|
|
15
17
|
def reset_password_in_progress?
|
@@ -19,6 +21,10 @@ module RailsJwtAuth
|
|
19
21
|
|
20
22
|
def self.included(base)
|
21
23
|
if base.ancestors.include? Mongoid::Document
|
24
|
+
# include GlobalID::Identification to use deliver_later method
|
25
|
+
# http://edgeguides.rubyonrails.org/active_job_basics.html#globalid
|
26
|
+
base.send(:include, GlobalID::Identification) if RailsJwtAuth.deliver_later
|
27
|
+
|
22
28
|
base.send(:field, :reset_password_token, type: String)
|
23
29
|
base.send(:field, :reset_password_sent_at, type: Time)
|
24
30
|
end
|
data/lib/rails_jwt_auth.rb
CHANGED