From 5b9dd0196b5be3a1118d46c7780c6f548752d290 Mon Sep 17 00:00:00 2001 From: Adam Thieme Date: Fri, 10 Jul 2026 02:28:51 +0000 Subject: [PATCH] feat(utils): return email as single URL-encoded component Match the new testbed ndncert /ndn/ naming convention by returning the lower-cased email as a single URL-encoded name component from convertEmailToName. Update existing callers in InvitePeopleModal.vue to use the new behavior. Legacy helper kept for backwards compatibility. --- src/components/InvitePeopleModal.vue | 4 ++-- src/utils/email.ts | 7 +------ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/components/InvitePeopleModal.vue b/src/components/InvitePeopleModal.vue index 6c1868cb..b73baec0 100644 --- a/src/components/InvitePeopleModal.vue +++ b/src/components/InvitePeopleModal.vue @@ -311,7 +311,7 @@ function addInvitee(invitee: string) { } // Convert email to NDN name - const ndnName = utils.convertEmailToNameLegacy(entry); + const ndnName = utils.convertEmailToName(entry); // Form profile new_profile = { name: ndnName, email: entry }; @@ -354,7 +354,7 @@ function addRequest(invitee: string) { } // Convert email to NDN name - const ndnName = utils.convertEmailToNameLegacy(entry); + const ndnName = utils.convertEmailToName(entry); // Form profile new_profile = { name: ndnName, email: entry }; diff --git a/src/utils/email.ts b/src/utils/email.ts index b62398f8..ede10a79 100644 --- a/src/utils/email.ts +++ b/src/utils/email.ts @@ -16,12 +16,7 @@ export function convertEmailToName(email: string): string { throw new Error('Invalid email address'); } - const parts = email.toLowerCase().split('@'); - const user = parts[0]; - const domain = parts[1]; - - // Technically @ is not allowed in URI, but NDNd can handle this - return `/${domain}/@${user}`; + return encodeURIComponent(email.toLowerCase()); } export function convertEmailToNameLegacy(email: string): string {