pvsoriano / react-auth0-1

React authentication app with Auth0 and Lock.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

React Authentication with Auth0 & Lock

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.

Run

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

Resources

About

React authentication app with Auth0 and Lock.

License:MIT License


Languages

Language:JavaScript 64.9%Language:HTML 21.0%Language:CSS 14.1%