Repository navigation
v2.0.0
π Major Release β v2.0.0
This release introduces a new architecture for "@nahnah/nestjs-auth-module".
It is a breaking change and represents a shift from feature-bundled auth to a capability-driven authentication system designed for real-world production use.
β¨ Whatβs New
π Capability-Based Architecture
Enable only the authentication features your app needs.
enabledCapabilities: ['credentials', 'google'];
Supported capabilities:
- "credentials" β Email/password authentication
- "google" β Google OAuth 2.0
This reduces surface area, improves security, and keeps your auth layer lean.
π§ Redesigned User Repository Contract
The user repository API has been simplified and made more flexible.
create(data: Partial)
update(id: string, data: Partial)
This design:
- Works naturally with ORMs (Prisma, TypeORM, Mongoose)
- Avoids rigid method explosion
- Makes extending user models trivial
π§© Interface-Driven, Domain-Friendly Design
Auth no longer owns your domain model.
- Extend "AuthUser" freely
- Bring your own database schema
- No forced fields beyond what auth truly needs
βοΈ Improved Module Configuration
- First-class async configuration support
- Cleaner JWT configuration
- Explicit credential & OAuth configuration blocks
- Better TypeScript inference and safety
π Documentation Overhaul
- Completely rewritten README
- Clear Quick Start
- Realistic examples
- Strong focus on DX and architecture clarity
β οΈ Breaking Changes
- v1 configuration API has been removed
- Auth features must now be explicitly enabled via "enabledCapabilities"
- User repository interface has changed
- Internal service APIs are not backward compatible
π This release requires manual migration.
πΊοΈ Roadmap
- Refresh token rotation & blacklisting
- Magic link authentication
- Email verification helpers
- Password reset flow helpers
- Additional OAuth providers (GitHub, Microsoft, etc.)