From 70dd926c9a626f7e8629b8549a0210bfb6792eca Mon Sep 17 00:00:00 2001 From: Santiago Rodriguez <46354312+santiagorodriguez96@users.noreply.github.com> Date: Wed, 22 Oct 2025 17:11:33 -0300 Subject: [PATCH 1/2] chore: improve `WebAuthn.origin` deprecation warning This will make it clear to users of the gem that using `WebAuthn.origin` when setting multiple allowed origins will make the former return `nil`. --- lib/webauthn/relying_party.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/webauthn/relying_party.rb b/lib/webauthn/relying_party.rb index 9d2b84d1..2fc06f9b 100644 --- a/lib/webauthn/relying_party.rb +++ b/lib/webauthn/relying_party.rb @@ -124,9 +124,9 @@ def verify_authentication( # DEPRECATED: This method will be removed in future. def origin warn( - "DEPRECATION WARNING: `WebAuthn.origin` is deprecated and will be removed in future. "\ - "Please use `WebAuthn.allowed_origins` instead "\ - "that also allows configuring multiple origins per Relying Party" + "DEPRECATION WARNING: `WebAuthn.origin` is deprecated and returns `nil` " \ + "when `WebAuthn.allowed_origins` contains more than one origin. " \ + "It will be removed in future. Please use `WebAuthn.allowed_origins` instead." ) allowed_origins.first if allowed_origins&.size == 1 From 477887fd8c3a648a7a9c732fe40a42cdd6e68187 Mon Sep 17 00:00:00 2001 From: Santiago Rodriguez <46354312+santiagorodriguez96@users.noreply.github.com> Date: Wed, 22 Oct 2025 17:13:57 -0300 Subject: [PATCH 2/2] chore: improve `WebAuthn.origin=` deprecation warning Make it clear that the method throwing the deprecation warning is the seter (`WebAuthn.origin=`) --- lib/webauthn/relying_party.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/webauthn/relying_party.rb b/lib/webauthn/relying_party.rb index 2fc06f9b..506e0b42 100644 --- a/lib/webauthn/relying_party.rb +++ b/lib/webauthn/relying_party.rb @@ -137,8 +137,8 @@ def origin=(new_origin) return if new_origin.nil? warn( - "DEPRECATION WARNING: `WebAuthn.origin` is deprecated and will be removed in future. "\ - "Please use `WebAuthn.allowed_origins` instead "\ + "DEPRECATION WARNING: `WebAuthn.origin=` is deprecated and will be removed in future. "\ + "Please use `WebAuthn.allowed_origins=` instead "\ "that also allows configuring multiple origins per Relying Party" )