react-lock

0.0.3 • Public • Published

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'
  }

Readme

Keywords

none

Package Sidebar

Install

npm i react-lock

Weekly Downloads

3

Version

0.0.3

License

ISC

Last publish

Collaborators

  • tomgasson