From 6f6018501bd7e312a6c0bd6418ee1334b503e557 Mon Sep 17 00:00:00 2001 From: Ivan Date: Thu, 22 Jul 2021 10:38:55 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=9B=B4=E6=96=B0=20auth=20=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 18 +++++++++--------- package.json | 2 +- src/articles/articles.module.ts | 3 ++- src/articles/articles.resolver.spec.ts | 5 +++++ src/commons/commons.module.ts | 2 +- 5 files changed, 18 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index bfff517..729d77f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,14 +1,14 @@ { "name": "blog-be", - "version": "0.0.1", + "version": "0.1.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "version": "0.0.1", + "version": "0.1.0", "license": "UNLICENSED", "dependencies": { - "@nestjs-lib/auth": "^0.1.1", + "@nestjs-lib/auth": "^0.2.1", "@nestjs/bull": "^0.3.1", "@nestjs/common": "^7.6.15", "@nestjs/config": "^0.6.2", @@ -2503,9 +2503,9 @@ } }, "node_modules/@nestjs-lib/auth": { - "version": "0.1.1", - "resolved": "https://npm.ivanli.cc/@nestjs-lib%2fauth/-/auth-0.1.1.tgz", - "integrity": "sha512-fYje3oHErN/1ZKyrzTlZ+3+w7fp3XplkKz26U9OycTA5hu+/LlM6EEvuMt7pfdo02KllVtcUWMtmKbezzr4Ujw==", + "version": "0.2.1", + "resolved": "https://npm.ivanli.cc/@nestjs-lib%2fauth/-/auth-0.2.1.tgz", + "integrity": "sha512-HNOjIWh6H/PVTjp+nQ11LmKY/09zNhlLZqruukTteAPKQGvkeLUU51/OIp/vj0WWzMxp4qMWnfCrLaRYjkQ1Yw==", "license": "MIT", "peerDependencies": { "@nestjs/common": "^7.0.0", @@ -17744,9 +17744,9 @@ } }, "@nestjs-lib/auth": { - "version": "0.1.1", - "resolved": "https://npm.ivanli.cc/@nestjs-lib%2fauth/-/auth-0.1.1.tgz", - "integrity": "sha512-fYje3oHErN/1ZKyrzTlZ+3+w7fp3XplkKz26U9OycTA5hu+/LlM6EEvuMt7pfdo02KllVtcUWMtmKbezzr4Ujw==", + "version": "0.2.1", + "resolved": "https://npm.ivanli.cc/@nestjs-lib%2fauth/-/auth-0.2.1.tgz", + "integrity": "sha512-HNOjIWh6H/PVTjp+nQ11LmKY/09zNhlLZqruukTteAPKQGvkeLUU51/OIp/vj0WWzMxp4qMWnfCrLaRYjkQ1Yw==", "requires": {} }, "@nestjs/bull": { diff --git a/package.json b/package.json index 7ce49b9..13ada3a 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "test:e2e": "jest --config ./test/jest-e2e.json" }, "dependencies": { - "@nestjs-lib/auth": "^0.1.1", + "@nestjs-lib/auth": "^0.2.1", "@nestjs/bull": "^0.3.1", "@nestjs/common": "^7.6.15", "@nestjs/config": "^0.6.2", diff --git a/src/articles/articles.module.ts b/src/articles/articles.module.ts index 7388681..24e6a86 100644 --- a/src/articles/articles.module.ts +++ b/src/articles/articles.module.ts @@ -1,3 +1,4 @@ +import { CommonsModule } from './../commons/commons.module'; import { Module } from '@nestjs/common'; import { ArticlesService } from './articles.service'; import { ArticlesResolver } from './articles.resolver'; @@ -5,7 +6,7 @@ import { TypeOrmModule } from '@nestjs/typeorm'; import { Article } from './entities/article.entity'; @Module({ - imports: [TypeOrmModule.forFeature([Article])], + imports: [TypeOrmModule.forFeature([Article]), CommonsModule], providers: [ArticlesResolver, ArticlesService], }) export class ArticlesModule {} diff --git a/src/articles/articles.resolver.spec.ts b/src/articles/articles.resolver.spec.ts index 9d1e7c6..4c3bdf9 100644 --- a/src/articles/articles.resolver.spec.ts +++ b/src/articles/articles.resolver.spec.ts @@ -1,3 +1,4 @@ +import { JwtService } from '@nestjs-lib/auth'; import { Test, TestingModule } from '@nestjs/testing'; import { ArticlesResolver } from './articles.resolver'; import { ArticlesService } from './articles.service'; @@ -13,6 +14,10 @@ describe('ArticlesResolver', () => { provide: ArticlesService, useValue: {}, }, + { + provide: JwtService, + useValue: {}, + }, ], }).compile(); diff --git a/src/commons/commons.module.ts b/src/commons/commons.module.ts index 26c2fd1..1e701bb 100644 --- a/src/commons/commons.module.ts +++ b/src/commons/commons.module.ts @@ -6,6 +6,6 @@ import { AuthModule } from '@nestjs-lib/auth'; @Module({ imports: [PubSubModule, AuthModule], providers: [PasswordConverter], - exports: [PasswordConverter], + exports: [PasswordConverter, AuthModule], }) export class CommonsModule {}