Skip to content

Latest commit

 

History

History
33 lines (27 loc) · 1 KB

README.md

File metadata and controls

33 lines (27 loc) · 1 KB

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/authentication-react

Usage

// src/index.tsx
import { AuthenticationProvider } from '@carp-dk/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.