├── .env.sample ├── .gitignore ├── .prettierrc ├── LICENSE ├── README.md ├── nest-cli.json ├── nodemon-debug.json ├── nodemon.json ├── package.json ├── src ├── app.controller.spec.ts ├── app.controller.ts ├── app.module.ts ├── app.service.ts ├── auth │ ├── auth.controller.spec.ts │ ├── auth.controller.ts │ ├── auth.module.ts │ ├── auth.service.spec.ts │ ├── auth.service.ts │ ├── jwt-payload.ts │ ├── models │ │ ├── login-response.ts │ │ ├── login.model.ts │ │ └── refresh-token.model.ts │ ├── strategies │ │ └── jwt-strategy.ts │ ├── token │ │ ├── token.service.spec.ts │ │ └── token.service.ts │ └── view-models │ │ ├── grant-types.enum.ts │ │ ├── login-response-vm.model.ts │ │ └── login-vm.model.ts ├── main.hmr.ts ├── main.ts ├── shared │ ├── api-exception.model.ts │ ├── base.model.ts │ ├── base.service.ts │ ├── configuration │ │ ├── configuration.service.spec.ts │ │ └── configuration.service.ts │ ├── decorators │ │ ├── ip.decorator.ts │ │ └── user.decorator.ts │ ├── errors │ │ └── not-found.error.ts │ ├── filters │ │ └── http-exception.filter.ts │ ├── interceptors │ │ └── snake-case.interceptor.ts │ ├── mapper │ │ ├── mapper.service.spec.ts │ │ └── mapper.service.ts │ ├── shared.module.ts │ └── utils │ │ ├── constants.ts │ │ ├── enum-to-array.ts │ │ └── get-operation-id.ts └── user │ ├── models │ ├── gender.enum.ts │ └── user.model.ts │ ├── user.controller.spec.ts │ ├── user.controller.ts │ ├── user.module.ts │ ├── user.service.spec.ts │ ├── user.service.ts │ └── view-models │ ├── register-user-vm.model.ts │ └── user-vm.model.ts ├── test ├── app.e2e-spec.ts └── jest-e2e.json ├── tsconfig.json ├── tsconfig.spec.json ├── tslint.json └── webpack.config.js /.env.sample: -------------------------------------------------------------------------------- 1 | PORT=1337 2 | MONGO_URI=mongodb://localhost:27017/nestjsauth 3 | JWT_KEY=jwt_awesome_key -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/.gitignore -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/.prettierrc -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/README.md -------------------------------------------------------------------------------- /nest-cli.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/nest-cli.json -------------------------------------------------------------------------------- /nodemon-debug.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/nodemon-debug.json -------------------------------------------------------------------------------- /nodemon.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/nodemon.json -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/package.json -------------------------------------------------------------------------------- /src/app.controller.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/src/app.controller.spec.ts -------------------------------------------------------------------------------- /src/app.controller.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/src/app.controller.ts -------------------------------------------------------------------------------- /src/app.module.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/src/app.module.ts -------------------------------------------------------------------------------- /src/app.service.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/src/app.service.ts -------------------------------------------------------------------------------- /src/auth/auth.controller.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/src/auth/auth.controller.spec.ts -------------------------------------------------------------------------------- /src/auth/auth.controller.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/src/auth/auth.controller.ts -------------------------------------------------------------------------------- /src/auth/auth.module.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/src/auth/auth.module.ts -------------------------------------------------------------------------------- /src/auth/auth.service.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/src/auth/auth.service.spec.ts -------------------------------------------------------------------------------- /src/auth/auth.service.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/src/auth/auth.service.ts -------------------------------------------------------------------------------- /src/auth/jwt-payload.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/src/auth/jwt-payload.ts -------------------------------------------------------------------------------- /src/auth/models/login-response.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/src/auth/models/login-response.ts -------------------------------------------------------------------------------- /src/auth/models/login.model.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/src/auth/models/login.model.ts -------------------------------------------------------------------------------- /src/auth/models/refresh-token.model.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/src/auth/models/refresh-token.model.ts -------------------------------------------------------------------------------- /src/auth/strategies/jwt-strategy.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/src/auth/strategies/jwt-strategy.ts -------------------------------------------------------------------------------- /src/auth/token/token.service.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/src/auth/token/token.service.spec.ts -------------------------------------------------------------------------------- /src/auth/token/token.service.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/src/auth/token/token.service.ts -------------------------------------------------------------------------------- /src/auth/view-models/grant-types.enum.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/src/auth/view-models/grant-types.enum.ts -------------------------------------------------------------------------------- /src/auth/view-models/login-response-vm.model.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/src/auth/view-models/login-response-vm.model.ts -------------------------------------------------------------------------------- /src/auth/view-models/login-vm.model.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/src/auth/view-models/login-vm.model.ts -------------------------------------------------------------------------------- /src/main.hmr.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/src/main.hmr.ts -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/src/main.ts -------------------------------------------------------------------------------- /src/shared/api-exception.model.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/src/shared/api-exception.model.ts -------------------------------------------------------------------------------- /src/shared/base.model.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/src/shared/base.model.ts -------------------------------------------------------------------------------- /src/shared/base.service.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/src/shared/base.service.ts -------------------------------------------------------------------------------- /src/shared/configuration/configuration.service.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/src/shared/configuration/configuration.service.spec.ts -------------------------------------------------------------------------------- /src/shared/configuration/configuration.service.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/src/shared/configuration/configuration.service.ts -------------------------------------------------------------------------------- /src/shared/decorators/ip.decorator.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/src/shared/decorators/ip.decorator.ts -------------------------------------------------------------------------------- /src/shared/decorators/user.decorator.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/src/shared/decorators/user.decorator.ts -------------------------------------------------------------------------------- /src/shared/errors/not-found.error.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/src/shared/errors/not-found.error.ts -------------------------------------------------------------------------------- /src/shared/filters/http-exception.filter.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/src/shared/filters/http-exception.filter.ts -------------------------------------------------------------------------------- /src/shared/interceptors/snake-case.interceptor.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/src/shared/interceptors/snake-case.interceptor.ts -------------------------------------------------------------------------------- /src/shared/mapper/mapper.service.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/src/shared/mapper/mapper.service.spec.ts -------------------------------------------------------------------------------- /src/shared/mapper/mapper.service.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/src/shared/mapper/mapper.service.ts -------------------------------------------------------------------------------- /src/shared/shared.module.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/src/shared/shared.module.ts -------------------------------------------------------------------------------- /src/shared/utils/constants.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/src/shared/utils/constants.ts -------------------------------------------------------------------------------- /src/shared/utils/enum-to-array.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/src/shared/utils/enum-to-array.ts -------------------------------------------------------------------------------- /src/shared/utils/get-operation-id.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/src/shared/utils/get-operation-id.ts -------------------------------------------------------------------------------- /src/user/models/gender.enum.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/src/user/models/gender.enum.ts -------------------------------------------------------------------------------- /src/user/models/user.model.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/src/user/models/user.model.ts -------------------------------------------------------------------------------- /src/user/user.controller.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/src/user/user.controller.spec.ts -------------------------------------------------------------------------------- /src/user/user.controller.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/src/user/user.controller.ts -------------------------------------------------------------------------------- /src/user/user.module.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/src/user/user.module.ts -------------------------------------------------------------------------------- /src/user/user.service.spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/src/user/user.service.spec.ts -------------------------------------------------------------------------------- /src/user/user.service.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/src/user/user.service.ts -------------------------------------------------------------------------------- /src/user/view-models/register-user-vm.model.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/src/user/view-models/register-user-vm.model.ts -------------------------------------------------------------------------------- /src/user/view-models/user-vm.model.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/src/user/view-models/user-vm.model.ts -------------------------------------------------------------------------------- /test/app.e2e-spec.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/test/app.e2e-spec.ts -------------------------------------------------------------------------------- /test/jest-e2e.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/test/jest-e2e.json -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/tsconfig.json -------------------------------------------------------------------------------- /tsconfig.spec.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/tsconfig.spec.json -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/tslint.json -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/abouroubi/nestjs-auth-jwt/HEAD/webpack.config.js --------------------------------------------------------------------------------