rails_jwt_auth 0.17.0 → 0.17.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f1b219bb8ec23bd8bcb9e32a01ac0a2b1ff65ad3
4
- data.tar.gz: 661143484c1f4affd78cf5ec8e484b52b8b35d48
3
+ metadata.gz: 7c2aed170511243b66a49dc2913ba59c5e00e5b5
4
+ data.tar.gz: a7cb07b8a569c4af7f6b65211be0109ba0d88ee0
5
5
  SHA512:
6
- metadata.gz: b25885a2765a541534f041c5e313781a46076810332d1275494b510d465103fd59716ceddcf41d4eda7b2615e2a29285a82c08eb1282b059cb4d30401e60278b
7
- data.tar.gz: b9a62d4b102d13e55fc20ccbe442bfda9deadb5c854b872ec65d1425093068aecc5b3cdc3407ff510eaf8d1f37b92f38ddf115a358c1f9f5a59b6ccf77fb24ec
6
+ metadata.gz: 14f8f7d270903f22e5adffab7f158e4d4a0c24ccae6bb6abd2d9cd9908901980b7699800ab00ee5ddbdef82446e51c6f2944f7176ffcc8dcb386945eb989ed4b
7
+ data.tar.gz: 7f326f34d1c084dbed94362941f7d4f9d493f23fdba54f1ccaa43ac60a8ac71f0c25088764caeb26c3ec4f254b290ae3b55b725643cd60210077bed23976b6be
@@ -59,7 +59,12 @@ module RailsJwtAuth
59
59
  if email_changed? && email_was && !confirmed_at_changed?
60
60
  self.unconfirmed_email = email
61
61
  self.email = email_was
62
- send_confirmation_instructions
62
+
63
+ self.confirmation_token = SecureRandom.base58(24)
64
+ self.confirmation_sent_at = Time.now
65
+
66
+ mailer = Mailer.confirmation_instructions(self)
67
+ RailsJwtAuth.deliver_later ? mailer.deliver_later : mailer.deliver
63
68
  end
64
69
  end
65
70
  end
@@ -67,9 +72,9 @@ module RailsJwtAuth
67
72
  private
68
73
 
69
74
  def validate_confirmation
70
- return true if !confirmed_at || email_changed?
75
+ return true unless confirmed_at
71
76
 
72
- if confirmed_at_was
77
+ if confirmed_at_was && !email_changed?
73
78
  errors.add(:email, I18n.t('rails_jwt_auth.errors.already_confirmed'))
74
79
  elsif confirmation_sent_at &&
75
80
  (confirmation_sent_at < (Time.now - RailsJwtAuth.confirmation_expiration_time))
@@ -1,3 +1,3 @@
1
1
  module RailsJwtAuth
2
- VERSION = '0.17.0'
2
+ VERSION = '0.17.1'
3
3
  end
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: 0.17.0
4
+ version: 0.17.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - rjurado
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-11 00:00:00.000000000 Z
11
+ date: 2017-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -126,9 +126,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
126
126
  version: '0'
127
127
  requirements: []
128
128
  rubyforge_project:
129
- rubygems_version: 2.4.5.1
129
+ rubygems_version: 2.5.2
130
130
  signing_key:
131
131
  specification_version: 4
132
132
  summary: Rails jwt authentication.
133
133
  test_files: []
134
- has_rdoc: