⚡️⚡️⚡️ Self-hosted collaborative bookmark manager to collect, read, annotate, and fully preserve what matters, all in one place.
TypeScript bookmarkbookmark-managercollaborationnextjsreact-nativeread-it-laterself-hostedtypescript
refactor: always hide email address from the public
daniel31x13155ca17b5597
diff --git a/apps/web/lib/api/controllers/public/users/getPublicUser.ts b/apps/web/lib/api/controllers/public/users/getPublicUser.tsindex 8c140735..ad54e6f2 100644--- a/apps/web/lib/api/controllers/public/users/getPublicUser.ts+++ b/apps/web/lib/api/controllers/public/users/getPublicUser.ts@@ -29,7 +29,6 @@ export default async function getPublicUser(id: lessSensitiveInfo.id,name: lessSensitiveInfo.name,username: lessSensitiveInfo.username,- email: lessSensitiveInfo.email,image: lessSensitiveInfo.image,archiveAsScreenshot: lessSensitiveInfo.archiveAsScreenshot,archiveAsMonolith: lessSensitiveInfo.archiveAsMonolith,diff --git a/apps/web/lib/client/addMemberToCollection.ts b/apps/web/lib/client/addMemberToCollection.tsindex dcde0abe..4888c29f 100644--- a/apps/web/lib/client/addMemberToCollection.ts+++ b/apps/web/lib/client/addMemberToCollection.ts@@ -16,12 +16,8 @@ const addMemberToCollection = async () => {const checkIfMemberAlreadyExists = collection.members.find((e) => {const username = (e.user.username || "").toLowerCase();- const email = (e.user.email || "").toLowerCase();- return (- username === memberIdentifier.toLowerCase() ||- email === memberIdentifier.toLowerCase()- );+ return username === memberIdentifier.toLowerCase();});if (@@ -47,7 +43,6 @@ const addMemberToCollection = async (id: user.id,name: user.name,username: user.username,- email: user.email,image: user.image,},});diff --git a/packages/types/global.ts b/packages/types/global.tsindex 8e25cf35..9913e72d 100644--- a/packages/types/global.ts+++ b/packages/types/global.ts@@ -32,7 +32,7 @@ export interface Member {canCreate: boolean;canUpdate: boolean;canDelete: boolean;- user: OptionalExcluding<User, "email" | "username" | "name" | "id">;+ user: OptionalExcluding<User, "username" | "name" | "id">;}export interface CollectionIncludingMembersAndLinkCount