How to use the u2f-api.isSupported function in u2f-api

To help you get started, we’ve selected a few u2f-api examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github LedgerHQ / ledgerjs / packages / hw-transport-u2f / src / TransportU2F.js View on Github external
static listen = (observer: *) => {
    let unsubscribed = false;
    isSupported().then(supported => {
      if (unsubscribed) return;
      if (supported) {
        observer.next({ type: "add", descriptor: null });
        observer.complete();
      } else {
        observer.error(
          new TransportError(
            "U2F browser support is needed for Ledger. " +
              "Please use Chrome, Opera or Firefox with a U2F extension. " +
              "Also make sure you're on an HTTPS connection",
            "U2FNotSupported"
          )
        );
      }
    });
    return {
github getsentry / sentry / src / sentry / static / sentry / app / components / u2f / u2finterface.jsx View on Github external
componentDidMount() {
    u2f.isSupported().then(supported => {
      this.setState({
        isSupported: supported,
      });
      if (!supported) {
        return;
      }
      this.invokeU2fFlow();
    });
  }
github MyEtherWallet / MyEtherWallet / src / layouts / AccessWalletLayout / components / HardwareModal / HardwareModal.vue View on Github external
mounted() {
    isSupported().then(res => {
      this.items.forEach(item => {
        const u2fhw = [SECALOT_TYPE, LEDGER_TYPE, BITBOX_TYPE];
        const inMobile = [SECALOT_TYPE, KEEPKEY_TYPE];
        const webUsb = [KEEPKEY_TYPE, LEDGER_TYPE];

        if (webUsb.includes(item.name)) {
          const disable =
            window.location.protocol !== 'https:' ||
            !window ||
            !window.navigator ||
            !window.navigator.usb;
          item.disabled = disable;
          item.msg = disable ? this.$t('errorsGlobal.browser-non-web-usb') : '';
        }
        if (u2fhw.includes(item.name)) {
          item.disabled = !res;
github authelia / authelia / client-react / src / containers / views / SecondFactorView / SecondFactorView.ts View on Github external
onStateLoaded: async (state: RemoteState) => {
      if (state.authentication_level < AuthenticationLevel.ONE_FACTOR) {
        ownProps.history.push('/');
        return;
      }
      const isU2FSupported = await u2fApi.isSupported();
      if (isU2FSupported) {
        await dispatch(setSecurityKeySupported(true));
        await triggerSecurityKeySigning(dispatch, ownProps);
      }
    }
  }

u2f-api

Promisified U2F API for browsers

MIT
Latest version published 3 years ago

Package Health Score

50 / 100
Full package analysis