Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@sean7218/auth-provider

sean72182ISC0.0.4

auth0 wrapper build on React Hooks Context API

readme

@sean7218/auth-provider

Usage

import { createAuth0Provider } from '@sean7218/auth-provider';

const AUTH0_CONFIG = {
    domain: 'auth.auth0.com',
    clientID: 'YOUR_CLIENT_ID',
    redirectUri: "http://localhost:3001/callback",
    responseType: 'token id_token',
    scope: 'openid profile email'
}

const Auth0Provider = createAuth0Provider(AUTH0_CONFIG, "development")

ReactDOM.render(
    <Auth0Provider>
        <Router history={history}>
            <Switch>
                <Route exact path="/" component={Home}/>
                <Route path="/callback" component={Callback}/>
                <Route path="/app" component={App} />
            </Switch>
        </Router>
    </Auth0Provider>, 
document.getElementById('root'));