Skip to content

Conversation

@santiagorodriguez96
Copy link
Contributor

Attempts to fix #481.

This PR updates the RelyingParty#origin (and thus WebAuthn.configuration.origin) so that, when there's only one allowed origin, it returns it while throwing a deprecation warning.

# DEPRECATED: This method will be removed in future.
def origin
warn(
"DEPRECATION WARNING: `WebAuthn.origin` is deprecated and will be removed in future. "\
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this say WebAuthn.configuration.origin instead? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good call! I actually made it so that it display message as the one we currently have.

Either way, this is confusing because the method is in RelyingParty, not in WebAuth::Configuration... perhaps we could make it so that it throws a different validation depending if you are calling RelyingParty#origin or WebAuth::Configuration#origin, but I'd leave it for a separate PR.

What do you think?

@santiagorodriguez96 santiagorodriguez96 merged commit 0be0492 into master Oct 21, 2025
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WebAuthn.configuration.origin readable but not assignable

2 participants