Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions src/components/InvitePeopleModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@

<div class="field mt-2">
<input class="input" type="text" :placeholder="`name@example.com or /ndn/user-name`" v-model="inviteInput"
:disabled="!canManageMembers" @keydown.enter.prevent="addInvitees(inviteInput)" @paste="addInviteesOnPaste" autofocus />
:disabled="!canManageMembers" @keydown.enter.prevent="addInvitees(inviteInput)" @paste="addInviteesOnPaste"
autofocus />
</div>

<div class="invitee-management">
Expand Down Expand Up @@ -56,12 +57,12 @@

<div class="email" v-if="item.email">{{ item.email }}</div>
</div>
<button class="button invitee-list-action" :disabled="!canManageMembers"
@click="acceptRequest(item)" title="Accept">
<button class="button invitee-list-action" :disabled="!canManageMembers" @click="acceptRequest(item)"
title="Accept">
<FontAwesomeIcon :icon="faCheck" />
</button>
<button class="button invitee-list-action" :disabled="!canManageMembers"
@click="denyRequest(item)" title="Deny">
<button class="button invitee-list-action" :disabled="!canManageMembers" @click="denyRequest(item)"
title="Deny">
<FontAwesomeIcon :icon="faXmark" />
</button>
</div>
Expand Down Expand Up @@ -113,17 +114,17 @@
</div>

<button class="button invitee-list-action" v-if="canManageMembers && !item.owner"
:disabled="resendingInvite === item.name"
@click="resendInvite(item.name)" title="Generate a new fast-join link for this person">
:disabled="resendingInvite === item.name" @click="resendInvite(item.name)"
title="Generate a new fast-join link for this person">
<FontAwesomeIcon :icon="faShare" />
</button>
<button class="button invitee-list-action" v-if="item.pending"
@click="removeInvitee(item.name)" title="Remove this pending invitee">
<button class="button invitee-list-action" v-if="item.pending" @click="removeInvitee(item.name)"
title="Remove this pending invitee">
<FontAwesomeIcon :icon="faXmark" />
</button>
<button class="button invitee-list-action" v-else-if="canManageMembers && !item.owner"
:disabled="removingMember === item.name"
@click="removeExistingMember(item.name)" title="Remove access to this workspace">
:disabled="removingMember === item.name" @click="removeExistingMember(item.name)"
title="Remove access to this workspace">
<FontAwesomeIcon :icon="faUserMinus" />
</button>
</div>
Expand Down Expand Up @@ -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 };
Expand Down
2 changes: 1 addition & 1 deletion src/components/landing/LandingLogin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 1 addition & 7 deletions src/utils/email.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading