From 24a3d210f006757f12f5d0e807be76539821c480 Mon Sep 17 00:00:00 2001 From: Andreas Knuth Date: Tue, 28 May 2024 17:26:45 -0500 Subject: [PATCH] renew ts value, better logging JWT --- bizmatch-server/src/jwt.strategy.ts | 5 +++-- .../edit-commercial-property-listing.component.ts | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bizmatch-server/src/jwt.strategy.ts b/bizmatch-server/src/jwt.strategy.ts index 58995d6..1b509cf 100644 --- a/bizmatch-server/src/jwt.strategy.ts +++ b/bizmatch-server/src/jwt.strategy.ts @@ -30,7 +30,6 @@ export class JwtStrategy extends PassportStrategy(Strategy) { } async validate(payload: JwtPayload): Promise { - this.logger.info('JWT Payload:', payload); // Debugging: JWT Payload anzeigen if (!payload) { this.logger.error('Invalid payload'); throw new UnauthorizedException(); @@ -39,6 +38,8 @@ export class JwtStrategy extends PassportStrategy(Strategy) { this.logger.error('Missing required claims'); throw new UnauthorizedException(); } - return { userId: payload.sub, username: payload.preferred_username, roles: payload.realm_access?.roles }; + const result = { userId: payload.sub, username: payload.preferred_username, roles: payload.realm_access?.roles }; + this.logger.info(`JWT User: ${JSON.stringify(result)}`); // Debugging: JWT Payload anzeigen + return result; } } diff --git a/bizmatch/src/app/pages/subscription/edit-commercial-property-listing/edit-commercial-property-listing.component.ts b/bizmatch/src/app/pages/subscription/edit-commercial-property-listing/edit-commercial-property-listing.component.ts index 9f76dd5..5b66b9d 100644 --- a/bizmatch/src/app/pages/subscription/edit-commercial-property-listing/edit-commercial-property-listing.component.ts +++ b/bizmatch/src/app/pages/subscription/edit-commercial-property-listing/edit-commercial-property-listing.component.ts @@ -175,6 +175,7 @@ export class EditCommercialPropertyListingComponent { this.imageService.uploadImage(blob, 'uploadPropertyPicture', this.listing.imagePath, this.listing.serialId).subscribe( async event => { if (event.type === HttpEventType.Response) { + this.ts = new Date().getTime(); console.log('Upload abgeschlossen', event.body); this.loadingService.stopLoading('uploadImage'); this.listing = await lastValueFrom(this.listingsService.getListingById(this.id, 'commercialProperty'));