react-lock

react-lock ============

Usage no npm install needed!

<script type="module">
  import reactLock from 'https://cdn.skypack.dev/react-lock';
</script>

README

react-lock

Usage

<Authenticate clientID="..." domain="....au.auth0.com" options={...lockOptions}>
  <App />
</Authenticate>

class App extends Component {
  static contextTypes = {
    token: PropTypes.string, // auth0 token
    profile: PropTypes.object, // auth0 profile object
    logIn: PropTypes.func, // lock.show
    logOut: PropTypes.func, // clear auth details
    loggedIn: PropTypes.bool // check if you're logged in
  }
  render(){
    // use context objects
  }
}

Setup

Your webpack config will unfortunatley also need these loaders

  {
    test: /node_modules[\\\/]auth0-lock[\\\/].*\.js$/,
    loaders: [
      'transform-loader/cacheable?brfs',
      'transform-loader/cacheable?packageify'
    ]
  }, {
    test: /node_modules[\\\/]auth0-lock[\\\/].*\.ejs$/,
    loader: 'transform-loader/cacheable?ejsify'
  }, {
    test: /\.json$/,
    loader: 'json-loader'
  }