renew ts value, better logging JWT
This commit is contained in:
parent
2465b8966b
commit
24a3d210f0
|
|
@ -30,7 +30,6 @@ export class JwtStrategy extends PassportStrategy(Strategy) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async validate(payload: JwtPayload): Promise<JwtUser> {
|
async validate(payload: JwtPayload): Promise<JwtUser> {
|
||||||
this.logger.info('JWT Payload:', payload); // Debugging: JWT Payload anzeigen
|
|
||||||
if (!payload) {
|
if (!payload) {
|
||||||
this.logger.error('Invalid payload');
|
this.logger.error('Invalid payload');
|
||||||
throw new UnauthorizedException();
|
throw new UnauthorizedException();
|
||||||
|
|
@ -39,6 +38,8 @@ export class JwtStrategy extends PassportStrategy(Strategy) {
|
||||||
this.logger.error('Missing required claims');
|
this.logger.error('Missing required claims');
|
||||||
throw new UnauthorizedException();
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -175,6 +175,7 @@ export class EditCommercialPropertyListingComponent {
|
||||||
this.imageService.uploadImage(blob, 'uploadPropertyPicture', this.listing.imagePath, this.listing.serialId).subscribe(
|
this.imageService.uploadImage(blob, 'uploadPropertyPicture', this.listing.imagePath, this.listing.serialId).subscribe(
|
||||||
async event => {
|
async event => {
|
||||||
if (event.type === HttpEventType.Response) {
|
if (event.type === HttpEventType.Response) {
|
||||||
|
this.ts = new Date().getTime();
|
||||||
console.log('Upload abgeschlossen', event.body);
|
console.log('Upload abgeschlossen', event.body);
|
||||||
this.loadingService.stopLoading('uploadImage');
|
this.loadingService.stopLoading('uploadImage');
|
||||||
this.listing = await lastValueFrom(this.listingsService.getListingById(this.id, 'commercialProperty'));
|
this.listing = await lastValueFrom(this.listingsService.getListingById(this.id, 'commercialProperty'));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue