npm run dev starts, your app already has working sign-in and sign-up screens, session management, and the wiring for OAuth and magic link flows. Your job is only to supply the credentials for whichever providers you want to activate.
What’s Included
Slik Dev’s auth setup covers three distinct capabilities out of the box:OAuth / Social Login
Social sign-in with providers like Google, GitHub, and others. OAuth flows are pre-wired — you only need to add your client ID and secret to
.env.Magic Links
Passwordless email authentication. Users receive a one-time sign-in link delivered to their inbox. No password storage required.
Session Management
Secure, JWT-based session handling via NextAuth. Sessions are validated server-side on every protected route. No manual middleware required.
Generated Auth Screens
Slik Dev generates two complete auth screens, both styled with your chosen theme and pre-connected to the NextAuth handler:- Sign In — An email/password form with OAuth provider buttons and a magic link option. Located at
/auth/signin(or/sign-independing on your App Router config). - Sign Up — An account creation screen with the same provider options.
Environment Variables
After scaffolding, open the.env file in your project root. You’ll see placeholder variables already written out for you:
NEXTAUTH_SECRET must be a random string of at least 32 characters. Generate one with: openssl rand -base64 32Configuring OAuth Providers After Scaffolding
1
Create an OAuth application with your provider
For Google: go to Google Cloud Console → APIs & Services → Credentials → Create Credentials → OAuth 2.0 Client ID.Set the Authorized redirect URI to:For production, add your live domain:
2
Copy your client ID and secret
After creating the OAuth app, copy the Client ID and Client Secret from your provider’s dashboard.
3
Add credentials to your .env file
Open
.env in your project root and fill in the values:4
Verify the provider is registered in your auth config
Slik generates a NextAuth configuration file at To add more providers, import them from
app/api/auth/[...nextauth]/route.ts. Open it and confirm your provider is listed:next-auth/providers and add them to the providers array.5
Restart the dev server and test sign-in
http://localhost:3000 and use the sign-in screen. The OAuth button for your configured provider should redirect to the provider’s consent screen.Protecting Routes
NextAuth session checks work with Next.js middleware. Your generated project includes amiddleware.ts file at the project root that protects the /dashboard and /admin routes by default:
matcher to extend protection to other pages.