Auth0, found here, is the provider for session management. Auth0 permits users to signin using Gmail, GitHub, LinkedIn and Microsoft accounts, or just make a new username/password. Auth0 handles all the security features (e.g., session management, user storing in the database or other risky aspects related to sessions).
Default .env file
.env files are under
src/dashboard/site. There should already be a filed called
src/dashboard/site/.env which serves as the template to list all the used variables along with some defaults if possible. This is what it looks like
Any env variable starting with
NEXT_PUBLIC_*will be available on both the site and server. Without this they will only be available on server.
NEXT_PUBLIC_NODE_ENVis used to simply display the node env on the site without having to do any API calls
NEXT_PUBLIC_Error_ImageIs the error image to show if for whatever reason images can be found
NEXT_PUBLIC_Time_Nextjs_CallsBy default the response time logging function only records the response times for calls to
NEXT_PUBLIC_Time_Nextjs_Callsas true the logging function will show the response times for every other call which is generally nextjs calls to load the page.
Creating .env files
There are 2 .env files that need to be created with an optional 3rd if you want to run unit tests on the local machine. The 2 mandatory files are
src/dashboard/site/.env.production.local. The 3rd optional file is
As a note any file with the format
.env.*.local will be ignored by git.
Values for the Auth0 variables can be found by following here
There are 2 Auth0 Tenants that are being used. One is for production and the other is for development. The reason being is that each inserts a User on first signin into the database. This is done through the use of rules.
- The rules section is under
- The code for the rule is as follows. Can be found at
- Make sure to have a catalog called
demoas a default catalog to assign, or remove code if there is none.
- Make sure to place the Mongodb URI