import { AuthComponents, AuthMiddleware, AuthReducer } from 'react-redux-auth0'
AUTH0_CLIENTID=client-id-string AUTH0_DOMAIN=domain npm your-start-command
Include Auth0 from CDN in your template (believe me, you don't want to build it):
<script src="http://cdn.auth0.com/js/lock-9.0.min.js"></script>
Make sure you have this webpack plugin so that webpack will compile in proper environment variables:
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(env),
'process.env.AUTH0_CLIENTID': JSON.stringify(AUTH0_CLIENTID),
'process.env.AUTH0_DOMAIN': JSON.stringify(AUTH0_DOMAIN)
})
...here is an example of reading those env variables in webpack config:
const env = process.env.NODE_ENV;
const AUTH0_CLIENTID = process.env.AUTH0_CLIENTID;
const AUTH0_DOMAIN = process.env.AUTH0_DOMAIN;
Can be used to render either a 'Sigup' or 'Login' button:
<LoginSignup login />
<LoginSignup signup />
A simple logout button.