How to use the @axa-fr/react-oidc-context-fetch/dist/withAuthentication function in @axa-fr/react-oidc-context-fetch

To help you get started, we’ve selected a few @axa-fr/react-oidc-context-fetch 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 AxaGuilDEv / dojo-react-oidc-context / exercice-sample / src / Pages / Admin / Admin.container.js View on Github external
this.props.displayMessage(error);
    }
  }
});

const withContext = fromRenderProps(
  MessageContext.Consumer,
  ({ displayMessage }) => ({ displayMessage })
);

const withBranch = hideIfNotData => branch(hideIfNotData, renderNothing);

export default compose(
  usersState,
  withContext,
  withAuthentication(fetch),
  withFetch,
  lifecycleHoc,
  withBranch(({ users }) => !users || users.length === 0)
)(Component);

@axa-fr/react-oidc-context-fetch

Inject authentification behavior to fetch using react High Order Component

MIT
Latest version published 4 years ago

Package Health Score

64 / 100
Full package analysis