class WebAuthn::CredentialCreationOptions

def to_h

def to_h
  options = {
    challenge: challenge,
    pubKeyCredParams: pub_key_cred_params,
    timeout: timeout,
    user: { id: user.id, name: user.name, displayName: user.display_name },
    rp: { name: rp.name }
  }
  if attestation
    options[:attestation] = attestation
  end
  if authenticator_selection
    options[:authenticatorSelection] = authenticator_selection
  end
  if exclude_credentials
    options[:excludeCredentials] = exclude_credentials
  end
  if extensions
    options[:extensions] = extensions
  end
  options
end