The example of React Authenticaion app with Auth0’s Lock.
The login/signup forms are embedded in /login
page.
The official tutorial is available at https://www.mokuji.me/article/react-auth0.
In order to run this sample app. first you need to create an Auth0 account and Auth0 client. Plus, you must add http://localhost:3000/login
to the Allowed Callback URLs, and http://localhost:3000
to the Allowed Web Origins on your Auth0 client setting.
After set up your Auth0 account, copy the repository and install dependencies:
$ git clone https://github.com/zacfukuda/react-auth0.git
$ cd react-auth0
$ yarn
Then create src/Auth/auth0-variables.js
, which defines variables for Auth0 client.
$ touch src/Auth/auth0-variables.js
The inside of auth0-variables.js
looks like this:
export const AUTH_CONFIG = {
domain: 'yourdomain.auth0.com',
clientId: 'yourclientid',
container: 'auth0-login-container'
}
And Finally,
$ yarn start
- React Login by Auth0
- Auth0 Lock
- Lock 11 for Web
- Lock Configuration Options
- auth0/lock (Github)