JSPM

stimulus-web-authn

0.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 16
  • Score
    100M100P100Q59331F
  • License MIT

A Stimulus controller for web authn

Package Exports

  • stimulus-web-authn
  • stimulus-web-authn/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (stimulus-web-authn) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Stimulus Web Authn

A Stimulus controller to implement web authn client side.

Installation

$ yarn add stimulus-web-authn

Usage

Register the controller with Stimulus:

// application.js
import { Application } from "@hotwired/stimulus"
import WebAuthnController from "stimulus-web-authn"

const application = Application.start()
application.register("web-authn", WebAuthnController)

Basic Example

<div
  data-controller="web-authn"
  data-web-authn-loading-class="web-authn-loading"
  data-web-authn-challenge-url-value="https://myapp.com/two_factor_authentication/challenge/web_authn/new"
  data-web-authn-verification-url-value="https://myapp.com/two_factor_authentication/challenge/web_authn"
  data-web-authn-fallback-url-value="/two_factor_authentication/challenge">

  <p data-web-authn-target="error" />

  <button type="button" data-web-authn-target="button" data-action="web-authn#getCredential">
    Use security key
  </button>
</div>

👷‍♂️ Contributing

Do not hesitate to contribute to the project by adapting or adding features ! Bug reports or pull requests are welcome.

📝 License

This project is released under the MIT license.