Next.js with Auth0 and Fauna
Robert Auld
Software DeveloperCreate a Next.js app.
Create a src directory at the project's root. Move pages and styles into src.
Install Prettier and the Prettier ESLint config npms.
Install Prettier VSCode extension.
Add a .prettierrc.json file:
Followed instructions here: https://vampiro.github.io/dev/docs/ for setting up husky for pre-commit hook Prettier formatting.
Auth#
Follow instructions for installing next-auth and adding the nextauth api endpoint and login/out component. https://github.com/nextauthjs/next-auth
Follow instructions for setting up your OAuth provider: https://next-auth.js.org/configuration/providers/oauth-provider
To configure in Google go here: https://console.cloud.google.com/apis/credentials. This involves setting up the origin and redirect urls inside Google. Should add localhost for development. Eventually add your Vercel domain.
Save off your client id and client secret into a .env.local file in your project.