authentication-zero 2.2.6 → 2.2.7

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
  SHA256:
3
- metadata.gz: 8f18ce45e177a0e4b7cdb47f22456d5516909dc516002ad33416474f7582a39b
4
- data.tar.gz: 18352b1de767047836853252e9a2832c84e6329002887724157a4dddb1d02f47
3
+ metadata.gz: 065a0e9195053ad906f495477bc12ffb7a299481f7ce1837389fe7123700b083
4
+ data.tar.gz: df7baaa9cc9ca5100664ab40884a4c6df62c7e92dc4497e050deb1ad2e91dea2
5
5
  SHA512:
6
- metadata.gz: 30be7c743f859f755d32a076ff1748c33f0803d53b3368a6e7914c756e7b5a8183864d07866b15d3b07e2e0ad77bfcd174386090ebe941e1eeee1e269ab57412
7
- data.tar.gz: 0b07f046c9ccfa17c4ad51fac9c4d4e59807c17f3f190acefc0d73168b32bb4b2112bdbcd14df75d402aa65b78f6c42edd68e18c55f0df39c5f1d4f2ffc7f67a
6
+ metadata.gz: b8506400f8d08c8bfdd0ecf43d25524deb75f23da5ea40dcfd8e9f8b983eded76219f4de68c0d8a31acbb58600992f1c1c6bd4f3da8e110c7985d276cfb7fa04
7
+ data.tar.gz: bfb7f162e36c9e31fef121998dd8b00aefe298b265a2fa781326a6090be2f788824f7d9fe9066909f80fb8a28f2385b807efbbfa68f71dc192e9d09ebefcf47c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- authentication-zero (2.2.6)
4
+ authentication-zero (2.2.7)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,3 +1,3 @@
1
1
  module AuthenticationZero
2
- VERSION = "2.2.6"
2
+ VERSION = "2.2.7"
3
3
  end
@@ -12,7 +12,7 @@ class EmailVerificationsController < ApplicationController
12
12
  private
13
13
  def set_<%= singular_table_name %>
14
14
  @<%= singular_table_name %> = <%= class_name %>.where(email: params[:email]).find_signed!(params[:token], purpose: params[:email])
15
- rescue ActiveSupport::MessageVerifier::InvalidSignature, ActiveRecord::RecordNotFound
15
+ rescue
16
16
  render json: { error: "That email verification link is invalid" }, status: :bad_request
17
17
  end
18
18
  end
@@ -22,7 +22,7 @@ class PasswordResetsController < ApplicationController
22
22
  private
23
23
  def set_<%= singular_table_name %>
24
24
  @<%= singular_table_name %> = <%= class_name %>.find_signed!(params[:token], purpose: :password_reset)
25
- rescue ActiveSupport::MessageVerifier::InvalidSignature
25
+ rescue
26
26
  render json: { error: "That password reset link is invalid" }, status: :bad_request
27
27
  end
28
28
 
@@ -14,7 +14,7 @@ class EmailVerificationsController < ApplicationController
14
14
  private
15
15
  def set_<%= singular_table_name %>
16
16
  @<%= singular_table_name %> = <%= class_name %>.where(email: params[:email]).find_signed!(params[:token], purpose: params[:email])
17
- rescue ActiveSupport::MessageVerifier::InvalidSignature, ActiveRecord::RecordNotFound
17
+ rescue
18
18
  redirect_to edit_email_path, alert: "That email verification link is invalid"
19
19
  end
20
20
  end
@@ -29,7 +29,7 @@ class PasswordResetsController < ApplicationController
29
29
  private
30
30
  def set_<%= singular_table_name %>
31
31
  @<%= singular_table_name %> = <%= class_name %>.find_signed!(params[:token], purpose: :password_reset)
32
- rescue ActiveSupport::MessageVerifier::InvalidSignature
32
+ rescue
33
33
  redirect_to new_password_reset_path, alert: "That password reset link is invalid"
34
34
  end
35
35
 
@@ -11,12 +11,12 @@ class <%= class_name %> < ApplicationRecord
11
11
  self.email = email.downcase.strip
12
12
  end
13
13
 
14
- after_create_commit do
15
- IdentityMailer.with(<%= singular_table_name %>: self).email_verify_confirmation.deliver_later
14
+ before_validation if: :email_changed? do
15
+ self.verified = false
16
16
  end
17
17
 
18
- after_update_commit if: :email_previously_changed? do
19
- update_columns verified: false
18
+ after_create_commit do
19
+ IdentityMailer.with(<%= singular_table_name %>: self).email_verify_confirmation.deliver_later
20
20
  end
21
21
 
22
22
  after_update_commit if: :email_previously_changed? do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: authentication-zero
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.6
4
+ version: 2.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nixon