Skip to content

v2.0.0

Choose a tag to compare

@tgenericx tgenericx released this 18 Dec 01:29
· 31 commits to main since this release

πŸš€ 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.)