feat: generate secret function and replaced few instances (#7810)

This PR fixes #4588

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
ZiaCodes
2024-10-30 16:07:11 +05:00
committed by GitHub
parent 1782865ff8
commit 57d9b8e8b4
75 changed files with 2860 additions and 1531 deletions

View File

@ -14,7 +14,6 @@ import { JsonWebTokenError, TokenExpiredError } from 'jsonwebtoken';
import { useThrottler } from 'src/engine/api/graphql/graphql-config/hooks/use-throttler';
import { WorkspaceSchemaFactory } from 'src/engine/api/graphql/workspace-schema.factory';
import { TokenService } from 'src/engine/core-modules/auth/token/services/token.service';
import { AuthContext } from 'src/engine/core-modules/auth/types/auth-context.type';
import { CoreEngineModule } from 'src/engine/core-modules/core-engine.module';
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
@ -36,7 +35,6 @@ export class GraphQLConfigService
implements GqlOptionsFactory<YogaDriverConfig<'express'>>
{
constructor(
private readonly tokenService: TokenService,
private readonly exceptionHandlerService: ExceptionHandlerService,
private readonly environmentService: EnvironmentService,
private readonly moduleRef: ModuleRef,

View File

@ -35,8 +35,8 @@ export class ActivityQueryResultGetterHandler
imageUrl.searchParams.delete('token');
const signedPayload = await this.fileService.encodeFileToken({
note_block_id: block.id,
workspace_id: workspaceId,
noteBlockId: block.id,
workspaceId: workspaceId,
});
return {

View File

@ -17,8 +17,8 @@ export class AttachmentQueryResultGetterHandler
}
const signedPayload = await this.fileService.encodeFileToken({
attachment_id: attachment.id,
workspace_id: workspaceId,
attachmentId: attachment.id,
workspaceId: workspaceId,
});
return {

View File

@ -17,8 +17,8 @@ export class PersonQueryResultGetterHandler
}
const signedPayload = await this.fileService.encodeFileToken({
person_id: person.id,
workspace_id: workspaceId,
personId: person.id,
workspaceId: workspaceId,
});
return {

View File

@ -17,8 +17,8 @@ export class WorkspaceMemberQueryResultGetterHandler
}
const signedPayload = await this.fileService.encodeFileToken({
workspace_member_id: workspaceMember.id,
workspace_id: workspaceId,
workspaceMemberId: workspaceMember.id,
workspaceId: workspaceId,
});
return {