From 74e5b56025bfd08d49321451b88ed34937943d81 Mon Sep 17 00:00:00 2001 From: Ghost Walker Date: Mon, 10 Jul 2023 10:26:17 +0300 Subject: [PATCH] Update auth.guard.ts --- integration/crud-typeorm/auth.guard.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/integration/crud-typeorm/auth.guard.ts b/integration/crud-typeorm/auth.guard.ts index 74ee1f36..6976508b 100644 --- a/integration/crud-typeorm/auth.guard.ts +++ b/integration/crud-typeorm/auth.guard.ts @@ -9,7 +9,11 @@ export class AuthGuard implements CanActivate { async canActivate(ctx: ExecutionContext): Promise { const req = ctx.switchToHttp().getRequest(); - req[USER_REQUEST_KEY] = await this.usersService.findOne(1); + req[USER_REQUEST_KEY] = await this.usersService.findOne({ + where: { + id: 1, + }, + }); return true; }