diff --git a/src/auth/guards/token-auth.guard.ts b/src/auth/guards/token-auth.guard.ts index 999ebcb..e0a2bc5 100644 --- a/src/auth/guards/token-auth.guard.ts +++ b/src/auth/guards/token-auth.guard.ts @@ -1,4 +1,4 @@ -import { CanActivate, ExecutionContext, ForbiddenException, Injectable, UnauthorizedException } from '@nestjs/common'; +import { CanActivate, ExecutionContext, ForbiddenException, Injectable, Logger, UnauthorizedException } from '@nestjs/common'; import * as ApiKey from 'uuid-apikey'; @Injectable() @@ -8,6 +8,12 @@ export class TokenAuthGuard implements CanActivate { const user = request.raw.user; const isLimitNotExceeded = request.raw.isLimitNotExceeded; const token = request?.headers['x-api-key'] || request['query']['token']; + const logger = new Logger(); + + logger.log(`Auth user form request`, { + token, + request: request.raw.url, + }); // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore const userToken = ApiKey.toAPIKey(user.token);