You can check out a live demo of the app on https://iotp-dashboard.vercel.app/ . It is hosted on vercel.
For our project, we are only able to create an account through the Auth0 dashboard for security reasons. If you want, you can let users sign up.
Steps to to run the code,
-
make sure you have npm installed or equivalent. Visit https://nodejs.org/en/ for more information if you do not have it installed.
-
clone this repositry or download the zip file
-
type in npm install at the root directory
-
Add a env file to the root directory of the file
-
go to auth0 website https://auth0.com/ and create a new application
-
add in an env file at the root directory of the project and add this in:
AUTH0_CLIENT_ID = ( auth0 client id here)
AUTH0_CLIENT_SECRET = (auth0 secret here)
AUTH0_ISSUER = (auth0 issuer address here)
NEXTAUTH_URL = (your website host address)
NEXT_PUBLIC_APP_ID = (your mongo app id)
AUTH0_AUDIENCE= (your auth0 audience)
NEXTAUTH_SECRET = (your nextauth secret here for middleware)
For more information I have found this website that explain the process of using Nextjs, Next-Auth and Auth0 pretty well https://javascript.plainenglish.io/how-to-authenticate-users-with-auth0-in-next-auth-9c1160ce48a8 .
Happy coding!