Sha256: 55d0e1d68adb36b1fa809189bd76c3781d1e9e469298c269af3337263919a84b
Contents?: true
Size: 686 Bytes
Versions: 60
Compression:
Stored size: 686 Bytes
Contents
import { Controller } from "@hotwired/stimulus"; import { create, parseCreationOptionsFromJSON, } from "@github/webauthn-json/browser-ponyfill"; export default class WebauthnRegistrationController extends Controller { static values = { options: Object }; static targets = ["response"]; submit(e) { if (this.responseTarget.value === "") { e.preventDefault(); this.createCredential(); } } createCredential() { create(this.options).then((response) => { this.responseTarget.value = JSON.stringify(response); this.element.requestSubmit(); }); } get options() { return parseCreationOptionsFromJSON(this.optionsValue); } }
Version data entries
60 entries across 60 versions & 1 rubygems