This project was bootstrapped with Create React App.
Example of authenticating a React application using the Auth0 SPA SDK
There are some important features in this repo:
- Using the Auth0 SPA SDK to create an React Context (auth0-context.js)
- Storing auth information in React Context (auth0-context.js)
- Protecting routes with a component
To try out this repo and see it in action:
- Clone the repo: git clone https://github.com/auth0-blog/react-auth0-spa-sdk-ga
- Install dependencies: npm install
- Change your credentials in auth0-context.js on line 19, 20
- Start the app: npm start
- View the app: http://localhost:3000