Update as_json to return string keys

This commit is contained in:
Stanko K.R.
2026-03-25 17:14:20 +01:00
parent f5ae2f8076
commit 5d0f52b57c
3 changed files with 42 additions and 36 deletions
@@ -35,12 +35,14 @@ class ActionPack::WebAuthn::PublicKeyCredential::RequestOptions < ActionPack::We
# Returns a Hash suitable for JSON serialization and passing to the
# WebAuthn JavaScript API.
def as_json(options = {})
{
json = {
challenge: challenge,
rpId: relying_party.id,
allowCredentials: credentials.map { |credential| allow_credential_json(credential) },
userVerification: user_verification.to_s
}.as_json(options)
}
json.as_json(options)
end
private