DirectoryFast
  • 🚀Get Started
  • 🔤Tutorials
    • Bring me to life!
    • How it's structured?
    • Make it yours
    • Bonus
  • 🛠️Features
    • AI
      • AI URL Scanner & Scan Jobs
    • Analytics
    • Authentication
    • API
      • Protected Endpoints
    • Blog
    • Database
    • Emails
    • Error Pages
    • Icons
    • Payments
    • Private Pages
    • SEO
  • 📦General Components
    • Shadcn/ui Components
    • Navbar
    • Footer
    • SignIn Modal
    • Hero Section
    • Social Proof
    • Collections Social Proof
    • Featured Section
    • Latest Collections Section
    • Latest Products Section
    • Recommended Section
  • 📦Directory Components
    • Product Card
    • Collection Card
    • Product Note
    • Search Bar
    • Tags
    • Product Options Toggle
    • Combobox
    • Multi-Combobox
    • Submit Product
    • Feature Product
    • Manage Note
    • Manage Collection
    • Dashboard Tables
  • ⛓️Links
    • GitHub Repository
    • Support
Powered by GitBook
On this page
  • Unique SignIn modal
  • Setup
  • Social Authentication
  • Magic Link
  1. Features

Authentication

Unlock interactive features for your users with NextAuth.

PreviousAnalyticsNextAPI

Last updated 11 months ago

Unique SignIn modal

The SignIn modal will be called everytime it's needed (Connect button or interaction with auth-only features)

It will update with your data automatically but you can customize it the way you want in the /components/layout/sign-in-modal.tsx file.

Setup

Fill your .env file:

.env
NEXTAUTH_SECRET=

Social Authentication

Google Auth is already pre-implemented, simply follow this guide:

  1. Access APIS & Services > Credentials > Configure Consent Screen

  2. Fill in all the info.

  3. Add userinfo.email and userinfo.profile to scope and Submit

  4. On Credentials, click Create Credentials > OAuth Client ID

  5. On Web Application add:

    1. Authorized JavaScript Origins > http://localhost:3000 & https://[YOURDOMAIN].com

    2. Authorized redirect URLs > http://localhost:3000/api/auth/callback/google & https://[YOURDOMAIN].com/api/auth/callback/google

  6. Submit

  7. OAuth Consent Screen > Publish App

Finally, copy your Client ID and Client Secret to the .env file:

.env
# Google Auth
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=

(GitHub, Facebook, Apple, Discord...)

Google Auth SIgnIn is now fully functional!

Magic Link

Traditional email/password authentication is becoming obsolete for obvious security reasons. Magic Links allows you not to store your users' passwords in your database, thus relieving you of responsibility.

To enable this option, you need an email SMTP server, provided here by Loops.

Your email SIgnIn is now fully functional!

Enter any string or generate a unique one with this .

Create a new project on

If you need more social authentication options, NextAuth offers a wide choice, which you can find .

👉 Check the to get started.

🛠️
Generator
Google Cloud
here
Emails section
SignIn Modal