New Project

Auth for subdomains

Learn how to secure sub domains using Next.js and NextAuth.

DeployView Demo
Learn how to secure sub domains using Next.js and NextAuth.

Subdomain Auth Example

Secure sub domains in Next.js using NextAuth.js.

Demo

  • solutions-subdomain-auth.vercel.sh (login from here)
  • subdomain.solutions-subdomain-auth.vercel.sh

How to Use

You can choose from one of the following two methods to use this repository:

One-Click Deploy

Deploy the example using Vercel:

Clone and Deploy

Execute create-next-app with pnpm to bootstrap the example:

pnpm create next-app --example https://github.com/vercel/examples/tree/main/solutions/subdomain-auth subdomain-auth

Next, run Next.js in development mode:

pnpm dev

Deploy it to the cloud with Vercel (Documentation).

GitHub Repovercel/examples
LicenseView License
Use Cases
Authentication
Multi-Tenant Apps
Stack
Next.js
Tailwind
Auth
NextAuth.js

Related Templates

Basic Auth Password Protection

Password protect pages in your application using Edge Middleware.
Basic Auth Password Protection thumbnail
DeployView Demo