A starter template for server-side authentication with Node.js using Auth0 (deployable to Heroku).
Based off of the official Auth0 Node.js Web App Sample.
Setup for Auth0 is fast and easy:
Create a Heroku account at Heroku - Sign up, and then click on this button:
This will set up a new application on your Heroku account using this repo as a template.
Choose your own app name, and use it in the
During setup you'll also be asked for some other environment variables, which is the information that we noted earlier in the Auth0 setup:
After Heroku is set up, return to the Auth0 Settings page and enter the URL in the Allowed urls (replace YOUR-APP with the App name that you chose):
It should appear like this:
Now everything should be set up! If you go to the application, it should allow you to register and log in to view your account details:
If you want to run the server locally, you can do this as follows:
Install the dependencies.
Copy the contents of
.env.example to a new file called
.env and replace the values for
AUTH0_CLIENT_SECRET with your Auth0 information (from the Settings page). Replace
EXPRESS_SESSION_SECRET with a secret to be used for the session.
# Copy configuration to replace with your own information cp .env.example .env
Run the app.
The app will be served at