rails_jwt_auth 0.15.0 → 0.15.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 44a233123ae5f2a0f6b39250ba799f8e31b2eea7
4
- data.tar.gz: e0ed55e3d8c7f7912fca191a9232d9d961765f36
3
+ metadata.gz: 91e496764ccca7f97d93242efd60a3547aea74e1
4
+ data.tar.gz: 74e02d9360d60324fd7eaa595045f00ced0d3424
5
5
  SHA512:
6
- metadata.gz: f6ab7cb0cd8afc764a7e4afa8d2924b12b11de19764ac6138047a2488214ab84fc98d982f67e5efe634f06d041473ed5b18cee11504a335e37117750bc4ca220
7
- data.tar.gz: e358f3a9332e4a2a2a75cb0d2e04677008e962e7feefac5a0f60a141bda4818841885b0b04a9d29c44ff902c0004a855266c17e03a71f7b507f2ef9dfd78b459
6
+ metadata.gz: 5adc97101b64c29b798323a60b10f4c928076fe5d7114f39d5c8c02b0867137713b2093a840182e4118713507528b03071d6d79b81f3af377eef32101cc70496
7
+ data.tar.gz: d973ea8cd11fc8b674e0288679fe8e91ce2498b26d1ee1771e4c026470bbd72a07c81caa2d8de44fb0f1845b273c74470b432f9c0ff0a86caa7370a5ea270659
@@ -3,7 +3,6 @@ if defined?(ActionMailer)
3
3
  default from: RailsJwtAuth.mailer_sender
4
4
 
5
5
  def confirmation_instructions(user)
6
- return unless user.confirmation_in_progress?
7
6
  @user = user
8
7
 
9
8
  if RailsJwtAuth.confirmation_url
@@ -21,7 +20,6 @@ if defined?(ActionMailer)
21
20
  end
22
21
 
23
22
  def reset_password_instructions(user)
24
- return unless user.reset_password_in_progress?
25
23
  @user = user
26
24
 
27
25
  if RailsJwtAuth.reset_password_url
@@ -1,17 +1,17 @@
1
1
  module RailsJwtAuth
2
2
  module Confirmable
3
3
  def send_confirmation_instructions
4
- if confirmed? && !unconfirmed_email_changed?
4
+ if confirmed? && !unconfirmed_email
5
5
  errors.add(:email, I18n.t('rails_jwt_auth.errors.already_confirmed'))
6
6
  return false
7
7
  end
8
8
 
9
9
  self.confirmation_token = SecureRandom.base58(24)
10
10
  self.confirmation_sent_at = Time.now
11
- return false unless save
12
11
 
13
12
  mailer = Mailer.confirmation_instructions(self)
14
13
  RailsJwtAuth.deliver_later ? mailer.deliver_later : mailer.deliver
14
+ save
15
15
  end
16
16
 
17
17
  def confirmed?
@@ -20,6 +20,7 @@ module RailsJwtAuth
20
20
 
21
21
  def confirm!
22
22
  self.confirmed_at = Time.now.utc
23
+ self.confirmation_token = nil
23
24
 
24
25
  if unconfirmed_email
25
26
  self.email = unconfirmed_email
@@ -31,11 +32,7 @@ module RailsJwtAuth
31
32
 
32
33
  def skip_confirmation!
33
34
  self.confirmed_at = Time.now.utc
34
- end
35
-
36
- def confirmation_in_progress?
37
- !confirmed_at && confirmation_token && confirmation_sent_at &&
38
- (Time.now < (confirmation_sent_at + RailsJwtAuth.confirmation_expiration_time))
35
+ self.confirmation_token = nil
39
36
  end
40
37
 
41
38
  def self.included(base)
@@ -14,11 +14,6 @@ module RailsJwtAuth
14
14
  RailsJwtAuth.deliver_later ? mailer.deliver_later : mailer.deliver
15
15
  end
16
16
 
17
- def reset_password_in_progress?
18
- reset_password_token && reset_password_sent_at &&
19
- (Time.now < (reset_password_sent_at + RailsJwtAuth.reset_password_expiration_time))
20
- end
21
-
22
17
  def self.included(base)
23
18
  if base.ancestors.include? Mongoid::Document
24
19
  # include GlobalID::Identification to use deliver_later method
@@ -1,3 +1,3 @@
1
1
  module RailsJwtAuth
2
- VERSION = '0.15.0'
2
+ VERSION = '0.15.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.15.0
4
+ version: 0.15.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-04-18 00:00:00.000000000 Z
11
+ date: 2017-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -125,8 +125,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
125
  version: '0'
126
126
  requirements: []
127
127
  rubyforge_project:
128
- rubygems_version: 2.5.2
128
+ rubygems_version: 2.4.5.1
129
129
  signing_key:
130
130
  specification_version: 4
131
131
  summary: Rails jwt authentication.
132
132
  test_files: []
133
+ has_rdoc: