diff --git a/src/auth/guards/AccessToken.guard.ts b/src/auth/guards/AccessToken.guard.ts index 7d30e78..159d57a 100644 --- a/src/auth/guards/AccessToken.guard.ts +++ b/src/auth/guards/AccessToken.guard.ts @@ -21,7 +21,7 @@ export class AccessTokenGuard implements CanActivate { context: ExecutionContext ): boolean | Promise | Observable { //@NoAuth 사용시 해당 부분에서 AccessTokenGuard 사용 해제시킴 - const noAuth = this.reflector.get('no-auth', context.getHandler()) + const noAuth = this.reflector.get('no-auth', context.getHandler()); if (noAuth) { return true; } @@ -56,6 +56,7 @@ export class AccessTokenGuard implements CanActivate { const payload = this.authService.verifyAccessJWT(jwtString); + // const user = payload const user = await this.authService.findUserById(payload.id); if (!user) { throw new UnauthorizedException( diff --git a/src/database/entities/user.entity.ts b/src/database/entities/user.entity.ts index 0c681e0..1dcc874 100644 --- a/src/database/entities/user.entity.ts +++ b/src/database/entities/user.entity.ts @@ -52,7 +52,7 @@ export class User { }) public role: Role; - @OneToMany(type => Comment, comment => comment.user, { eager: true }) + @OneToMany(type => Comment, comment => comment.user, { eager: false }) public comments: Comment[]; @ApiProperty({ @@ -60,7 +60,7 @@ export class User { type: () => [Order] }) @Expose() - @OneToMany(type => Order, order => order.user, { eager: true }) + @OneToMany(type => Order, order => order.user, { eager: false }) public order: Order[]; @ApiProperty({ @@ -68,7 +68,7 @@ export class User { type: () => [Ticket] }) @Expose() - @OneToMany(type => Ticket, ticket => ticket.user, { eager: true }) + @OneToMany(type => Ticket, ticket => ticket.user, { eager: false }) public ticket: Ticket[]; @ApiProperty({