diff --git a/backend/src/services/participant.service.ts b/backend/src/services/participant.service.ts index c4e2b37..dc93360 100644 --- a/backend/src/services/participant.service.ts +++ b/backend/src/services/participant.service.ts @@ -9,10 +9,7 @@ import { inject, injectable } from 'inversify'; import { ParticipantInfo } from 'livekit-server-sdk'; import { MeetRoomHelper } from '../helpers/room.helper.js'; import { validateMeetTokenMetadata } from '../middlewares/index.js'; -import { - errorParticipantIdentityNotProvided, - errorParticipantNotFound -} from '../models/error.model.js'; +import { errorParticipantIdentityNotProvided, errorParticipantNotFound } from '../models/error.model.js'; import { FrontendEventService, LiveKitService, @@ -81,7 +78,10 @@ export class ParticipantService { const role = await this.roomService.getRoomRoleBySecret(roomId, secret); const token = await this.generateParticipantToken(finalParticipantOptions, role, currentRoles); - this.logger.verbose(`Participant token generated for room '${roomId}' with name '${finalParticipantName}'`); + this.logger.verbose( + `Participant token generated for room '${roomId}'` + + (finalParticipantName ? ` with name '${finalParticipantName}'` : '') + ); return token; } diff --git a/backend/src/services/token.service.ts b/backend/src/services/token.service.ts index eab5b66..8579e25 100644 --- a/backend/src/services/token.service.ts +++ b/backend/src/services/token.service.ts @@ -55,9 +55,7 @@ export class TokenService { let { participantIdentity } = participantOptions; if (participantName && !participantIdentity) { - // Generate participant identity based on name and unique ID - const identityPrefix = participantName.replace(/\s+/g, ''); // Remove all spaces - participantIdentity = `${identityPrefix}-${uid(8)}`; + participantIdentity = participantName; } const metadata: MeetTokenMetadata = {