@carp-dk/authentication-react
v1.0.1
Published
A wrapper for [oidc-client-ts](https://github.com/authts/oidc-client-ts) and [react-oidc-context](https://github.com/authts/react-oidc-context) for shared authentication config and logic across CARP react projects
Downloads
45
Readme
CARP Authenticator React
A wrapper for oidc-client-ts and react-oidc-context for shared authentication config and logic across CARP react projects
Installation
bun i @carp-dk/carp-authentication-react
Usage
// src/index.tsx
import { AuthenticationProvider } from '@carp-dk/carp-authentication-react';
import App from './pages/App';
const container = document.getElementById('root');
const root = createRoot(container);
root.render(
<AuthenticationProvider
config={{
authority: "<your authority>",
client_id: "<your client id>",
redirect_uri: "<your redirect uri>",
}}
>
<App />
</AuthenticationProvider>
);
Folder Structure
Source code is found under src, components are found in components/ and each component should have it's own folder. Utility functions should reside inside utils/ folder.