
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
nextauthforge
Advanced tools
Plug-and-play authentication scaffolding for Next.js App Router.
Add production-ready auth to any Next.js project in under a minute.
npx nextauthforge init
No global install needed. Just run and follow the prompts.
◆ AUTHFORGE — Next.js Auth Scaffolder
? What is your project name? my-app
? Which database are you using? MongoDB
? Include login & signup pages? Yes
? Include example dashboard & profile pages? Yes
✓ Auth files scaffolded
✓ Dependencies installed
✓ AuthForge setup complete!
your-project/
├─ src/
│ ├─ app/
│ │ ├─ (auth)/
│ │ │ ├─ login/page.tsx ← Login UI
│ │ │ └─ signup/page.tsx ← Signup UI
│ │ ├─ api/auth/
│ │ │ ├─ login/route.ts ← POST /api/auth/login
│ │ │ ├─ signup/route.ts ← POST /api/auth/signup
│ │ │ ├─ logout/route.ts ← POST /api/auth/logout
│ │ │ └─ me/route.ts ← GET /api/auth/me
│ │ ├─ dashboard/page.tsx ← Protected dashboard
│ │ └─ page.tsx ← Landing page
│ ├─ components/ToasterProvider.tsx
│ ├─ hooks/useAuth.tsx
│ ├─ lib/
│ │ ├─ dbConfig.ts
│ │ ├─ hash.ts
│ │ ├─ jwt.ts
│ │ └─ session.ts
│ └─ models/user.models.js
└─ proxy.ts ← Route protection middleware
Browser
│
│ POST /api/auth/login
▼
Route Handler
│ validate → hash → JWT → httpOnly cookie
▼
MongoDB
│
▼
Cookie in browser → proxy.ts verifies on every protected route
| Method | Endpoint | Description |
|---|---|---|
POST | /api/auth/signup | Register + auto login |
POST | /api/auth/login | Login + set cookie |
POST | /api/auth/logout | Clear session |
GET | /api/auth/me | Get current user |
Create .env.local in your project root:
MONGODB_URI=mongodb+srv://<user>:<pass>@cluster.mongodb.net/dbname
TOKEN_SECRET=your-secret-key-minimum-32-characters
Add <ToasterProvider /> to your src/app/layout.tsx:
import ToasterProvider from "@/src/components/ToasterProvider"
export default function RootLayout({ children }) {
return (
<html>
<body>
<ToasterProvider />
{children}
</body>
</html>
)
}
httpOnly cookie — immune to XSSsecure flag on in productionsameSite: lax CSRF protectionjose library — Edge Runtime compatibleMiddleware protects these routes out of the box:
/dashboard → JWT required
/profile → JWT required
/settings → JWT required
/login → redirects to /dashboard if already logged in
/signup → redirects to /dashboard if already logged in
| Package | Purpose |
|---|---|
jose | JWT (Edge Runtime safe) |
bcryptjs | Password hashing |
mongoose | MongoDB ODM |
axios | HTTP requests |
react-hot-toast | Notifications |
nextauthforge add google commandMIT © Gaurav Kumar
Built for the Next.js community 🚀
FAQs
Plug-and-play authentication scaffolding tool for Next.js App Router
We found that nextauthforge demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.