{"_id":"@10abdullahbutt/auth-module","name":"@10abdullahbutt/auth-module","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@10abdullahbutt/auth-module","version":"1.0.0","description":"A NestJS-style authentication module with JWT and role-based access control.","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc -p tsconfig.json","test":"jest","lint":"eslint src --ext .ts","prepublishOnly":"npm run build","prepare":"husky install"},"keywords":["nestjs","auth","jwt","rbac","role-based","module"],"author":{"name":"Boolmind"},"license":"MIT","dependencies":{"@nestjs/common":">=10.0.0","@nestjs/config":"^4.0.2","@nestjs/core":">=10.0.0","@nestjs/jwt":"^10.0.0","@nestjs/passport":"^10.0.0","passport":"^0.6.0","passport-jwt":"^4.0.1","reflect-metadata":"^0.1.13","rxjs":"^7.8.0"},"devDependencies":{"@nestjs/testing":"^10.0.0","@types/express":"^5.0.3","@types/jest":"^29.5.2","@types/node":"^20.0.0","@types/passport":"^1.0.17","@types/passport-jwt":"^4.0.1","@typescript-eslint/eslint-plugin":"^6.0.0","@typescript-eslint/parser":"^6.0.0","eslint":"^8.0.0","eslint-config-prettier":"^10.1.5","eslint-plugin-prettier":"^5.5.1","husky":"^9.1.7","jest":"^29.5.0","prettier":"^3.6.2","ts-jest":"^29.1.0","ts-node":"^10.9.1","typescript":"^5.0.0"},"peerDependencies":{"@nestjs/common":">=10.0.0","@nestjs/core":">=10.0.0"},"_id":"@10abdullahbutt/auth-module@1.0.0","gitHead":"38652fc0edf88a4a568f275642971f58f66cbeb9","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-Ucqy/qUWUS/WGLO3sbbg3VQrCqk1z0dews90bX+RuTp1hzLsJmbKBZqNyZ9RP7TY/iTb79PRTj9tYsP0XgGwdg==","shasum":"c61c26678dc465d0031a2f00c19327b303e5869f","tarball":"https://registry.npmjs.org/@10abdullahbutt/auth-module/-/auth-module-1.0.0.tgz","fileCount":41,"unpackedSize":156833,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCV640SuJgbpakrNFO01tOWWnR5zyyolwOwuWphA6F11wIgUgFXwpY6Y+Y5lghPGgCguvkFTHJY8zEjtONjT6Hz82A="}]},"_npmUser":{"name":"10abdullahbutt","email":"naeem.dev@boolmind.com","actor":{"name":"10abdullahbutt","email":"naeem.dev@boolmind.com","type":"user"}},"directories":{},"maintainers":[{"name":"10abdullahbutt","email":"naeem.dev@boolmind.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/auth-module_1.0.0_1752077055498_0.31448041163489604"},"_hasShrinkwrap":false}},"time":{"created":"2025-07-09T16:04:15.433Z","1.0.0":"2025-07-09T16:04:15.746Z","modified":"2025-07-09T16:04:16.026Z"},"maintainers":[{"name":"10abdullahbutt","email":"naeem.dev@boolmind.com"}],"description":"A NestJS-style authentication module with JWT and role-based access control.","keywords":["nestjs","auth","jwt","rbac","role-based","module"],"author":{"name":"Boolmind"},"license":"MIT","readme":"# @10abdullahbutt/auth-module\n\nA NestJS-style authentication module providing JWT authentication and role-based access control (RBAC).\n\n## Features\n- JWT authentication guard\n- Role-based access control guard\n- Custom roles decorator\n- Easily pluggable into any NestJS application\n\n## Installation\n\n```bash\nnpm install @10abdullahbutt/auth-module\n```\n\n## Usage\n\n### Import the Module\n\n```typescript\nimport { Module } from '@nestjs/common';\nimport { AuthModule } from '@10abdullahbutt/auth-module';\n\n@Module({\n  imports: [\n    AuthModule,\n  ],\n})\nexport class AppModule {}\n```\n\n### Configure JWT\n\nOverride the `JwtModule.register` options in your main app for secret and expiration:\n\n```typescript\nimport { JwtModule } from '@nestjs/jwt';\n\n@Module({\n  imports: [\n    JwtModule.register({\n      secret: process.env.JWT_SECRET,\n      signOptions: { expiresIn: '1h' },\n    }),\n  ],\n})\nexport class AppModule {}\n```\n\n### Protect Routes with JWT\n\n```typescript\nimport { Controller, Get, UseGuards } from '@nestjs/common';\nimport { JwtAuthGuard } from '@10abdullahbutt/auth-module';\n\n@Controller('profile')\nexport class ProfileController {\n  @UseGuards(JwtAuthGuard)\n  @Get()\n  getProfile() {\n    // ...\n  }\n}\n```\n\n### Role-based Access\n\n```typescript\nimport { Controller, Get, UseGuards } from '@nestjs/common';\nimport { Roles, RolesGuard, JwtAuthGuard } from '@10abdullahbutt/auth-module';\n\n@Controller('admin')\n@UseGuards(JwtAuthGuard, RolesGuard)\nexport class AdminController {\n  @Roles('admin')\n  @Get()\n  getAdminData() {\n    // ...\n  }\n}\n```\n\n## Testing\n\n```bash\nnpm run test\n```\n\n## License\n\nMIT ","readmeFilename":"README.md","_rev":"1-96bf93ffa343e121cd5bf84434862cd7"}