diff --git a/src/Invitation.ts b/src/Invitation.ts index b9286d2b7..07cecd8f5 100644 --- a/src/Invitation.ts +++ b/src/Invitation.ts @@ -47,7 +47,7 @@ export class InvitationV1 implements invitation.InvitationV1 { .replace(/=*$/g, '') // Replace slashes with dashes so that the topic is still easily split by / // We do not treat this as needing to be valid Base64 anywhere - .replace('/', '-') + .replace(/\//g, '-') ) const keyMaterial = crypto.getRandomValues(new Uint8Array(32)) diff --git a/test/utils/topic.test.ts b/test/utils/topic.test.ts index 1f0879754..2baf3d6e0 100644 --- a/test/utils/topic.test.ts +++ b/test/utils/topic.test.ts @@ -36,7 +36,7 @@ describe('topic utils', () => { .replace(/=*$/g, '') // Replace slashes with dashes so that the topic is still easily split by / // We do not treat this as needing to be valid Base64 anywhere - .replace('/', '-') + .replace(/\//g, '-') ) )