Skip to content

AlterClassIO/magic-next-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

0e2077a · Dec 5, 2021

History

16 Commits
Dec 5, 2021
Nov 23, 2021
Dec 5, 2021
Nov 22, 2021
Nov 23, 2021
Dec 5, 2021
Nov 22, 2021
Nov 22, 2021
Nov 22, 2021
Nov 30, 2021
Nov 22, 2021
Dec 5, 2021
Dec 5, 2021
Nov 23, 2021
Dec 5, 2021

Repository files navigation

Magic NextAuth

Magic Link Authentication in Next.js with NextAuth and Fauna by AlterClass.io.

  • Learn to build this application step-by-step by following the tutorial on AlterClass.

  • Preview the app live here.

  • Deploy the same app using Vercel:

Deploy with Vercel

Getting Started

1. Clone the repository and install dependencies

git clone https://github.com/AlterClassIO/magic-next-auth
cd magic-next-auth
npm install

2. Configure your local environment

Rename the .env.local.example file in this directory to .env.local (which will be ignored by Git):

cp .env.local.example .env.local

Add details for the SMTP server.

3. Start the application

To run your site locally, use:

npm run dev

To run it in production mode, use:

npm run build
npm run start

4. Preparing for Production

You must set the NEXTAUTH_URL environment variable with the URL of your site, before deploying to production.

e.g. in your .env.local file - NEXTAUTH_URL=https://example.com

To do this with Vercel, you can use the Vercel project dashboard or their cli via the vc env command:

vc env add NEXTAUTH_URL production

License

MIT