Skip to content

Commit 0b7801a

Browse files
committed
feat: improve JWT authentication error logging details
1 parent a8dfeb8 commit 0b7801a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/common/guards/jwt-guards/def-jwt-guard.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ export class JwtDefaultGuard extends AuthGuard('registeredUserJWT') {
1010
if (info instanceof Error || err || !user) {
1111
const response = context.switchToHttp().getResponse();
1212

13-
this.logger.error(`Incorrent SSL_CERT or JWT: ${err}`);
13+
this.logger.error(
14+
`Incorrect SSL_CERT or JWT! Request dropped. URL: ${context.switchToHttp().getRequest().url}, IP: ${context.switchToHttp().getRequest().ip}}`,
15+
);
1416

1517
response.socket?.destroy();
1618
throw new UnauthorizedException('Unauthorized');

0 commit comments

Comments
 (0)