katalyst-koi 5.11.5 → 5.12.0

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: c9152c315e534ac8308874565166fca173df77f919af3104e17a3ae198b5d66c
4
- data.tar.gz: 4d54135239dc294bdc334b9be7aaa6df8d3db2c216c6079fddd8b83baa0713b8
3
+ metadata.gz: afee7b805fac88ecb5a44d5c133496622e254163996ff365dfd25a80c61bf280
4
+ data.tar.gz: 23245c78eba9d5cf35c489811939c290c54ad0e3ec3adca50fb99cac612f394b
5
5
  SHA512:
6
- metadata.gz: f089a059a9fc1b36e266e37c604eb7d5cc563eb6f118a2e04da2bd0d89f0281982757b49474d017e0793f755010ee894e97bfd786c6cf8ce892fb3ce5bba1113
7
- data.tar.gz: ec2a37f520c6ade602c86aa091760735bec7f268be858189d9d9dde8ec01aa5720336a8a4ded36201bbb97bc270e26e3592fcd9006fbf492e9c29ebe8d6e22ee
6
+ metadata.gz: 474bfc88b55a6666838dfe870359e3c647d099120b48673e17242666ea30f60a0a82d25ec02e7277cf220be45b1f250a8bd8a1f02e86580e8b9042e8b7a74503
7
+ data.tar.gz: bda368a27d974f89bfa75371643c74a2bbf424202fc6304a1f1fee7b61173a574e1134b19eb8e9269259691d6cec46db06f3c47a58f6317be7c3a0d8f207c3e5
@@ -49,8 +49,11 @@ module Koi
49
49
  def webauthn_authenticate!(response)
50
50
  return if response.blank?
51
51
 
52
+ credential = JSON.parse(response)
53
+ return false unless credential.is_a?(Hash)
54
+
52
55
  webauthn_credential, stored_credential = webauthn_relying_party.verify_authentication(
53
- JSON.parse(response),
56
+ credential,
54
57
  session.delete(:authentication_challenge),
55
58
  ) do |credential|
56
59
  Admin::Credential.find_by!(external_id: credential.id)
@@ -62,7 +65,7 @@ module Koi
62
65
  )
63
66
 
64
67
  stored_credential.admin
65
- rescue ActiveRecord::RecordNotFound, WebAuthn::VerificationError
68
+ rescue ActiveRecord::RecordNotFound, WebAuthn::VerificationError, JSON::ParserError
66
69
  false
67
70
  end
68
71
 
@@ -75,8 +75,8 @@ module Koi
75
75
  # @param model [ActiveRecord::Base] The record to create an archive/delete link for
76
76
  # @param archive_text [String] Text to display for archive link (default: "Archive")
77
77
  # @param delete_text [String] Text to display for delete link (default: "Delete")
78
- # @param confirm [String] Confirmation message for delete action (default: "Are you sure?")
79
- # @param url [String] Target url for delete actions (defaults to admin_<record>_path)
78
+ # @param confirm [String] Confirmation message for archive and delete actions (default: "Are you sure?")
79
+ # @param url [String] Target url for archive and delete actions (defaults to admin_<record>_path)
80
80
  # @param ** Additional HTML attributes to pass to the link
81
81
  # @return [String, nil] Returns the HTML link element, or nil if record is not persisted
82
82
  #
@@ -97,7 +97,7 @@ module Koi
97
97
  if model.archived?
98
98
  link_to(delete_text, url, data: { turbo_method: :delete, turbo_confirm: confirm }, **)
99
99
  else
100
- link_to(archive_text, url, data: { turbo_method: :delete }, **)
100
+ link_to(archive_text, url, data: { turbo_method: :delete, turbo_confirm: confirm }, **)
101
101
  end
102
102
  end
103
103
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: katalyst-koi
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.11.5
4
+ version: 5.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katalyst Interactive