authentication-zero 2.2.5 → 2.2.6

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: cbf5451c5736444444c73e85d59820172c61985c90393c5a3eb4fc7e92dd476e
4
- data.tar.gz: f6bea74bc5e5334f27036ce75831562d3f0e95e9eaea76be7e5d1e799df2afd6
3
+ metadata.gz: 8f18ce45e177a0e4b7cdb47f22456d5516909dc516002ad33416474f7582a39b
4
+ data.tar.gz: 18352b1de767047836853252e9a2832c84e6329002887724157a4dddb1d02f47
5
5
  SHA512:
6
- metadata.gz: a0ae090e81d5ffe5149c3d2dea1a1ca64071335829393700732458c1f6b4d8167335c23e74cf1370e49b7f14a1751ecfd28e3d68205b7303198544a4a209ec73
7
- data.tar.gz: bd43ec57382214d285cdd556b68468096aad74b689e41df5cce770d5334b1d11e1858267fd31aedf7260509f34b7e95b41d6e8f3cd50dc64e63f5170bbcf1e15
6
+ metadata.gz: 30be7c743f859f755d32a076ff1748c33f0803d53b3368a6e7914c756e7b5a8183864d07866b15d3b07e2e0ad77bfcd174386090ebe941e1eeee1e269ab57412
7
+ data.tar.gz: 0b07f046c9ccfa17c4ad51fac9c4d4e59807c17f3f190acefc0d73168b32bb4b2112bdbcd14df75d402aa65b78f6c42edd68e18c55f0df39c5f1d4f2ffc7f67a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- authentication-zero (2.2.5)
4
+ authentication-zero (2.2.6)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,3 +1,3 @@
1
1
  module AuthenticationZero
2
- VERSION = "2.2.5"
2
+ VERSION = "2.2.6"
3
3
  end
@@ -38,7 +38,6 @@ class AuthenticationGenerator < Rails::Generators::NamedBase
38
38
  def create_fixture_file
39
39
  if options.fixture && options.fixture_replacement.nil?
40
40
  template "#{test_framework}/fixtures.yml", "test/fixtures/#{fixture_file_name}.yml"
41
- template "#{test_framework}/sessions.yml", "test/fixtures/sessions.yml"
42
41
  end
43
42
  end
44
43
 
@@ -6,17 +6,13 @@ class EmailVerificationsController < ApplicationController
6
6
  end
7
7
 
8
8
  def update
9
- if Current.<%= singular_table_name %>.email == params[:email]
10
- @<%= singular_table_name %>.update! verified: true
11
- else
12
- render json: { error: "That email verification link is invalid" }, status: :bad_request
13
- end
9
+ @<%= singular_table_name %>.update! verified: true
14
10
  end
15
11
 
16
12
  private
17
13
  def set_<%= singular_table_name %>
18
- @<%= singular_table_name %> = <%= class_name %>.find_signed!(params[:token], purpose: params[:email])
19
- rescue ActiveSupport::MessageVerifier::InvalidSignature
14
+ @<%= singular_table_name %> = <%= class_name %>.where(email: params[:email]).find_signed!(params[:token], purpose: params[:email])
15
+ rescue ActiveSupport::MessageVerifier::InvalidSignature, ActiveRecord::RecordNotFound
20
16
  render json: { error: "That email verification link is invalid" }, status: :bad_request
21
17
  end
22
18
  end
@@ -1,13 +1,9 @@
1
1
  class EmailVerificationsController < ApplicationController
2
- before_action :set_<%= singular_table_name %>, only: :edit
2
+ before_action :set_<%= singular_table_name %>, only: %i[ edit update ]
3
3
 
4
4
  def edit
5
- if Current.<%= singular_table_name %>.email == params[:email]
6
- @<%= singular_table_name %>.update! verified: true
7
- redirect_to root_path, notice: "Thank you for verifying your email address"
8
- else
9
- redirect_to edit_email_path, alert: "That email verification link is invalid"
10
- end
5
+ @<%= singular_table_name %>.update! verified: true
6
+ redirect_to root_path, notice: "Thank you for verifying your email address"
11
7
  end
12
8
 
13
9
  def create
@@ -17,8 +13,8 @@ class EmailVerificationsController < ApplicationController
17
13
 
18
14
  private
19
15
  def set_<%= singular_table_name %>
20
- @<%= singular_table_name %> = <%= class_name %>.find_signed!(params[:token], purpose: params[:email])
21
- rescue ActiveSupport::MessageVerifier::InvalidSignature
16
+ @<%= singular_table_name %> = <%= class_name %>.where(email: params[:email]).find_signed!(params[:token], purpose: params[:email])
17
+ rescue ActiveSupport::MessageVerifier::InvalidSignature, ActiveRecord::RecordNotFound
22
18
  redirect_to edit_email_path, alert: "That email verification link is invalid"
23
19
  end
24
20
  end
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.5
4
+ version: 2.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nixon
@@ -76,7 +76,6 @@ files:
76
76
  - lib/generators/authentication/templates/test_unit/controllers/html/registrations_controller_test.rb.tt
77
77
  - lib/generators/authentication/templates/test_unit/controllers/html/sessions_controller_test.rb.tt
78
78
  - lib/generators/authentication/templates/test_unit/fixtures.yml.tt
79
- - lib/generators/authentication/templates/test_unit/sessions.yml.tt
80
79
  - lib/generators/authentication/templates/test_unit/system/emails_test.rb.tt
81
80
  - lib/generators/authentication/templates/test_unit/system/password_resets_test.rb.tt
82
81
  - lib/generators/authentication/templates/test_unit/system/passwords_test.rb.tt
@@ -1,6 +0,0 @@
1
- # Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2
-
3
- lazaro_nixon_ios:
4
- <%= singular_table_name %>: lazaro_nixon
5
- user_agent: Device iOS
6
- ip_address: 127.0.0.1