From 7ffed9f4772a9f894ba3a926a9f075dfde099821 Mon Sep 17 00:00:00 2001 From: Sergiy Date: Sat, 28 Sep 2024 13:01:20 +0300 Subject: [PATCH] production: + logs --- backend/src/bundles/public-video/public-video.controller.ts | 3 ++- backend/src/bundles/videos/video.repository.ts | 3 ++- backend/src/common/services/token/token.services.ts | 2 ++ .../bundles/common/api/public-video-api/public-videos-api.ts | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/backend/src/bundles/public-video/public-video.controller.ts b/backend/src/bundles/public-video/public-video.controller.ts index f864f9128..b0c565f12 100644 --- a/backend/src/bundles/public-video/public-video.controller.ts +++ b/backend/src/bundles/public-video/public-video.controller.ts @@ -30,7 +30,8 @@ class PublicVideoController extends BaseController { ): Promise { const headers = options.headers as Record; const videoTokenHeader = headers['video_token']?.toString() ?? ''; - + // eslint-disable-next-line no-console + console.log(videoTokenHeader); return { status: HTTPCode.OK, payload: diff --git a/backend/src/bundles/videos/video.repository.ts b/backend/src/bundles/videos/video.repository.ts index ed0b8bc91..26542e5fe 100644 --- a/backend/src/bundles/videos/video.repository.ts +++ b/backend/src/bundles/videos/video.repository.ts @@ -21,7 +21,8 @@ class VideoRepository implements Repository { public async findById(id: string): Promise { const video = await this.videoModel.query().findById(id).execute(); - + // eslint-disable-next-line no-console + console.log(video); return video ? VideoEntity.initialize(video) : null; } diff --git a/backend/src/common/services/token/token.services.ts b/backend/src/common/services/token/token.services.ts index fe69dc4ce..9da1f26b1 100644 --- a/backend/src/common/services/token/token.services.ts +++ b/backend/src/common/services/token/token.services.ts @@ -34,6 +34,8 @@ class TokenService { public async getIdFromToken(token: string): Promise { const payload = await this.verifyToken(token); + // eslint-disable-next-line no-console + console.log(payload); return (payload?.['id'] as string) ?? null; } } diff --git a/frontend/src/bundles/common/api/public-video-api/public-videos-api.ts b/frontend/src/bundles/common/api/public-video-api/public-videos-api.ts index 373297685..c242cea47 100644 --- a/frontend/src/bundles/common/api/public-video-api/public-videos-api.ts +++ b/frontend/src/bundles/common/api/public-video-api/public-videos-api.ts @@ -21,7 +21,7 @@ class PublicVideosApi extends BaseHttpApi { headers.append('video_token', jwt.replaceAll('~', '.')); // eslint-disable-next-line no-console - console.log('headers', headers); + console.log('headers', headers.get('video_token')); const options = { method: HTTPMethod.GET,