authentication-zero 2.15.5 → 2.15.6

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
  SHA256:
3
- metadata.gz: d543ebd70ad0bc5b3d734d96c106cabef8b8219ad44fce3a75ce90d7670d9084
4
- data.tar.gz: a4c506a4746e6c8aba5b09dbb26d7f93d9fde4c52dc5fb7690c1e6e41f0cf988
3
+ metadata.gz: b316d9409a50bdffa5cdbd059e1702886235a9dc192ffe5d52ff442c20489517
4
+ data.tar.gz: 3921791567de9009be45c56f3073dbb7220d7798c524a6895a82753761ff9a7c
5
5
  SHA512:
6
- metadata.gz: b474eaf63504fb13acb7c6444757070faf3375059aea062026c3329bf5f2e270a52f08a7cdead777ce12d639ae558e6ecac6a9e6dc83bd576f75e7f109f22aa7
7
- data.tar.gz: 50af59feb9c1effb0e3b0260bf2f6420af9bae84ae7cbeab13fe2b0de508c23a58e52f4db7c5d6a8cac38d937d4e5d0f4c0e498af16a26657d5461c2d1b788ab
6
+ metadata.gz: 1fb6ecefd1929fbf8a1d2e989bd3240f5fcc55ee19f920cbe5bb36f2dce8a3209d11b261b5455f38a88d5ad66c187c6f8b647ff86e55bad4bd5140240e0b5b0e
7
+ data.tar.gz: e239a86be051925c5632e6686a97751267c9b478dee52a8dd87c9a5fdd983a2821fea73e30af98a3b34061d14ad9c37b49f94ac8c6d2d561c122561a522108bc
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- authentication-zero (2.15.5)
4
+ authentication-zero (2.15.6)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,3 +1,3 @@
1
1
  module AuthenticationZero
2
- VERSION = "2.15.5"
2
+ VERSION = "2.15.6"
3
3
  end
@@ -1,7 +1,7 @@
1
1
  class UserMailer < ApplicationMailer
2
2
  def password_reset
3
3
  @user = params[:user]
4
- @signed_id = @user.create_password_reset_token.signed_id(expires_in: 20.minutes)
4
+ @signed_id = @user.password_reset_tokens.create.signed_id(expires_in: 20.minutes)
5
5
 
6
6
  mail to: @user.email, subject: "Reset your password"
7
7
  end
@@ -11,7 +11,7 @@ class UserMailer < ApplicationMailer
11
11
  <%- if code_verifiable? -%>
12
12
  @user.verification_code.value = rand.to_s[2..7]
13
13
  <%- else -%>
14
- @signed_id = @user.create_email_verification_token.signed_id(expires_in: 2.days)
14
+ @signed_id = @user.email_verification_tokens.create.signed_id(expires_in: 2.days)
15
15
  <%- end -%>
16
16
 
17
17
  mail to: @user.email, subject: "Verify your email"
@@ -1,7 +1,7 @@
1
1
  class <%= migration_class_name %> < ActiveRecord::Migration[<%= ActiveRecord::Migration.current_version %>]
2
2
  def change
3
3
  create_table :email_verification_tokens do |t|
4
- t.references :user, null: false, foreign_key: false
4
+ t.references :user, null: false, foreign_key: true
5
5
  end
6
6
  end
7
7
  end
@@ -1,7 +1,7 @@
1
1
  class <%= migration_class_name %> < ActiveRecord::Migration[<%= ActiveRecord::Migration.current_version %>]
2
2
  def change
3
3
  create_table :password_reset_tokens do |t|
4
- t.references :user, null: false, foreign_key: false
4
+ t.references :user, null: false, foreign_key: true
5
5
  end
6
6
  end
7
7
  end
@@ -1,8 +1,8 @@
1
1
  class User < ApplicationRecord
2
2
  has_secure_password
3
3
 
4
- has_one :email_verification_token, dependent: :destroy
5
- has_one :password_reset_token, dependent: :destroy
4
+ has_many :email_verification_tokens, dependent: :destroy
5
+ has_many :password_reset_tokens, dependent: :destroy
6
6
 
7
7
  has_many :sessions, dependent: :destroy
8
8
  <%- if options.trackable? -%>
@@ -19,14 +19,14 @@ class Identity::EmailVerificationsControllerTest < ActionDispatch::IntegrationTe
19
19
  end
20
20
 
21
21
  test "should verify email" do
22
- sid = @user.create_email_verification_token.signed_id(expires_in: 2.days)
22
+ sid = @user.email_verification_tokens.create.signed_id(expires_in: 2.days)
23
23
 
24
24
  get edit_identity_email_verification_url, params: { sid: sid }, headers: default_headers
25
25
  assert_response :no_content
26
26
  end
27
27
 
28
28
  test "should not verify email with expired token" do
29
- sid_exp = @user.create_email_verification_token.signed_id(expires_in: 0.minutes)
29
+ sid_exp = @user.email_verification_tokens.create.signed_id(expires_in: 0.minutes)
30
30
 
31
31
  get edit_identity_email_verification_url, params: { sid: sid_exp }, headers: default_headers
32
32
  assert_response :bad_request
@@ -15,14 +15,14 @@ class Identity::EmailVerificationsControllerTest < ActionDispatch::IntegrationTe
15
15
  end
16
16
 
17
17
  test "should verify email" do
18
- sid = @user.create_email_verification_token.signed_id(expires_in: 2.days)
18
+ sid = @user.email_verification_tokens.create.signed_id(expires_in: 2.days)
19
19
 
20
20
  get edit_identity_email_verification_url(sid: sid, email: @user.email)
21
21
  assert_redirected_to root_url
22
22
  end
23
23
 
24
24
  test "should not verify email with expired token" do
25
- sid_exp = @user.create_email_verification_token.signed_id(expires_in: 0.minutes)
25
+ sid_exp = @user.email_verification_tokens.create.signed_id(expires_in: 0.minutes)
26
26
 
27
27
  get edit_identity_email_verification_url(sid: sid_exp, email: @user.email)
28
28
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: authentication-zero
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.15.5
4
+ version: 2.15.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nixon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-19 00:00:00.000000000 Z
11
+ date: 2022-08-24 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: