diff --git a/src/components/InvitePeopleModal.vue b/src/components/InvitePeopleModal.vue index 6409eaa1..8286a4fb 100644 --- a/src/components/InvitePeopleModal.vue +++ b/src/components/InvitePeopleModal.vue @@ -28,7 +28,8 @@
+ :disabled="!canManageMembers" @keydown.enter.prevent="addInvitees(inviteInput)" @paste="addInviteesOnPaste" + autofocus />
@@ -56,12 +57,12 @@
{{ item.email }}
- - @@ -113,17 +114,17 @@ - @@ -363,7 +364,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 }; diff --git a/src/components/landing/LandingLogin.vue b/src/components/landing/LandingLogin.vue index 82689afb..bfd75106 100644 --- a/src/components/landing/LandingLogin.vue +++ b/src/components/landing/LandingLogin.vue @@ -430,7 +430,7 @@ function emailSubmit() { // fail outright or produce a testbed key that doesn't chain to the // bundle's ephemeral cert. if (fastJoinBundle.value) { - const predicted = utils.convertEmailToNameLegacy(emailAddress.value); + const predicted = utils.convertEmailToName(emailAddress.value); if (predicted !== fastJoinBundle.value.inviteeIdentity) { emailError.value = `This email produces identity "${predicted}" but the fast-join link designates "${fastJoinBundle.value.inviteeIdentity}". Use a different email or contact the inviter.`; return; diff --git a/src/utils/email.ts b/src/utils/email.ts index fc030ef2..ceb4f33e 100644 --- a/src/utils/email.ts +++ b/src/utils/email.ts @@ -15,13 +15,7 @@ export function convertEmailToName(email: string): string { if (!validateEmail(email)) { 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 {