vintage-auth v1.0.7 is a drop-in authentication system for Express.js applications, providing JWT-based authentication with MongoDB as the backing store. It offers pre-built routes for signup, login, and logout, session management via HTTP-only cookies, and middleware for protecting routes. The package is designed to minimize boilerplate for common Express auth workflows but offers limited customization compared to alternatives like Passport.js. Release cadence is irregular with no recent updates, suggesting potential stability risks. Compatible with Express 4.x, it assumes MongoDB and Mongoose as the ORM.
npm install vintage-authNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initializes vintage-auth with default settings, adds auth routes and protects a GET endpoint.
Update to `import vintageAuth from 'vintage-auth'` then `app.use(vintageAuth())` (call it as a function).
Replace `vintageAuth.authenticate` with `import { protect } from 'vintage-auth'` and use as middleware.Ensure `mongoose.connect()` completes (await or then) before `app.use(vintageAuth())`.
Use `import { configAuth } from 'vintage-auth'` to define custom user schema fields.Use `import vintageAuth from 'vintage-auth'` in an ESM project, or add `"type": "module"` to package.json.
Await `mongoose.connect()` before using vintageAuth middleware.
Ensure `app.use(vintageAuth())` is placed before protected routes.