⚡️⚡️⚡️ 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
revert
Isaaccd3f5f7e7051
diff --git a/pages/api/v1/archives/[linkId].ts b/pages/api/v1/archives/[linkId].tsindex d558308f..34b1e9e7 100644--- a/pages/api/v1/archives/[linkId].ts+++ b/pages/api/v1/archives/[linkId].ts@@ -158,7 +158,7 @@ async function handlePost(req: NextApiRequest, res: NextApiResponse) {// Verify user and collection permissionsconst user = await verifyUser({ req, res });- if (!user) return res.status(401).json({ response: "Unauthorized" }); // verifyUser already handles the response on failure+ if (!user) return; // verifyUser already handles the response on failureconst collectionPermissions = await getPermission({userId: user.id,diff --git a/pages/api/v1/collections/[id].ts b/pages/api/v1/collections/[id].tsindex df95f737..94090317 100644--- a/pages/api/v1/collections/[id].ts+++ b/pages/api/v1/collections/[id].ts@@ -9,7 +9,7 @@ export default async function collections(res: NextApiResponse) {const user = await verifyUser({ req, res });- if (!user) return res.status(401).json({ response: "Unauthorized" });+ if (!user) return;const collectionId = Number(req.query.id);diff --git a/pages/api/v1/collections/index.ts b/pages/api/v1/collections/index.tsindex 6631635a..3198ea5e 100644--- a/pages/api/v1/collections/index.ts+++ b/pages/api/v1/collections/index.ts@@ -8,7 +8,7 @@ export default async function collections(res: NextApiResponse) {const user = await verifyUser({ req, res });- if (!user) return res.status(401).json({ response: "Unauthorized" });+ if (!user) return;if (req.method === "GET") {const collections = await getCollections(user.id);diff --git a/pages/api/v1/dashboard/index.ts b/pages/api/v1/dashboard/index.tsindex 0073b93c..e4abcba5 100644--- a/pages/api/v1/dashboard/index.ts+++ b/pages/api/v1/dashboard/index.ts@@ -8,7 +8,7 @@ export default async function dashboard(res: NextApiResponse) {const user = await verifyUser({ req, res });- if (!user) return res.status(401).json({ response: "Unauthorized" });+ if (!user) return;if (req.method === "GET") {const convertedData: LinkRequestQuery = {diff --git a/pages/api/v1/links/[id]/archive/index.ts b/pages/api/v1/links/[id]/archive/index.tsindex 3edf82c1..2b9589b4 100644--- a/pages/api/v1/links/[id]/archive/index.ts+++ b/pages/api/v1/links/[id]/archive/index.ts@@ -10,7 +10,7 @@ const RE_ARCHIVE_LIMIT = Number(process.env.RE_ARCHIVE_LIMIT) || 5;export default async function links(req: NextApiRequest, res: NextApiResponse) {const user = await verifyUser({ req, res });- if (!user) return res.status(401).json({ response: "Unauthorized" });+ if (!user) return;const link = await prisma.link.findUnique({where: {diff --git a/pages/api/v1/links/[id]/index.ts b/pages/api/v1/links/[id]/index.tsindex 4354e884..7f33c662 100644--- a/pages/api/v1/links/[id]/index.ts+++ b/pages/api/v1/links/[id]/index.ts@@ -6,7 +6,7 @@ import verifyUser from "@/lib/api/verifyUser";export default async function links(req: NextApiRequest, res: NextApiResponse) {const user = await verifyUser({ req, res });- if (!user) return res.status(401).json({ response: "Unauthorized" });+ if (!user) return;if (req.method === "GET") {const updated = await getLinkById(user.id, Number(req.query.id));diff --git a/pages/api/v1/links/archive/index.ts b/pages/api/v1/links/archive/index.tsindex 81ea2b9a..07ffe02c 100644--- a/pages/api/v1/links/archive/index.ts+++ b/pages/api/v1/links/archive/index.ts@@ -11,7 +11,7 @@ import { ArchivalSettings } from "@/lib/api/archiveHandler";export default async function links(req: NextApiRequest, res: NextApiResponse) {const user = await verifyUser({ req, res });- if (!user) return res.status(401).json({ response: "Unauthorized" });+ if (!user) return;const isServerAdmin = user.id === Number(process.env.NEXT_PUBLIC_ADMIN || 1);diff --git a/pages/api/v1/links/index.ts b/pages/api/v1/links/index.tsindex dd6eef38..dc7a2173 100644--- a/pages/api/v1/links/index.ts+++ b/pages/api/v1/links/index.ts@@ -8,7 +8,7 @@ import updateLinks from "@/lib/api/controllers/links/bulk/updateLinks";export default async function links(req: NextApiRequest, res: NextApiResponse) {const user = await verifyUser({ req, res });- if (!user) return res.status(401).json({ response: "Unauthorized" });+ if (!user) return;if (req.method === "GET") {// Convert the type of the request query to "LinkRequestQuery"diff --git a/pages/api/v1/migration/index.ts b/pages/api/v1/migration/index.tsindex 09e022b6..d7c52ffb 100644--- a/pages/api/v1/migration/index.ts+++ b/pages/api/v1/migration/index.ts@@ -19,7 +19,7 @@ export const config = {export default async function users(req: NextApiRequest, res: NextApiResponse) {const user = await verifyUser({ req, res });- if (!user) return res.status(401).json({ response: "Unauthorized" });+ if (!user) return;if (req.method === "GET") {const data = await exportData(user.id);diff --git a/pages/api/v1/rss/[id].ts b/pages/api/v1/rss/[id].tsindex b434424f..14de272c 100644--- a/pages/api/v1/rss/[id].ts+++ b/pages/api/v1/rss/[id].ts@@ -7,7 +7,7 @@ export default async function handler(res: NextApiResponse) {const user = await verifyUser({ req, res });- if (!user) return res.status(401).json({ response: "Unauthorized" });+ if (!user) return;const rssId = Number(req.query.id);diff --git a/pages/api/v1/rss/index.ts b/pages/api/v1/rss/index.tsindex 733570e0..1a4ea6fe 100644--- a/pages/api/v1/rss/index.ts+++ b/pages/api/v1/rss/index.ts@@ -9,7 +9,7 @@ export default async function handler(res: NextApiResponse) {const user = await verifyUser({ req, res });- if (!user) return res.status(401).json({ response: "Unauthorized" });+ if (!user) return;if (req.method === "GET") {const response = await prisma.rssSubscription.findMany({diff --git a/pages/api/v1/tags/[id].ts b/pages/api/v1/tags/[id].tsindex 91ae8d6b..6aa8194d 100644--- a/pages/api/v1/tags/[id].ts+++ b/pages/api/v1/tags/[id].ts@@ -5,7 +5,7 @@ import deleteTagById from "@/lib/api/controllers/tags/tagId/deleteTagById";export default async function tags(req: NextApiRequest, res: NextApiResponse) {const user = await verifyUser({ req, res });- if (!user) return res.status(401).json({ response: "Unauthorized" });+ if (!user) return;const tagId = Number(req.query.id);diff --git a/pages/api/v1/tags/index.ts b/pages/api/v1/tags/index.tsindex adb92650..5783e4a2 100644--- a/pages/api/v1/tags/index.ts+++ b/pages/api/v1/tags/index.ts@@ -6,7 +6,7 @@ import createOrUpdateTags from "@/lib/api/controllers/tags/createOrUpdateTags";export default async function tags(req: NextApiRequest, res: NextApiResponse) {const user = await verifyUser({ req, res });- if (!user) return res.status(401).json({ response: "Unauthorized" });+ if (!user) return;if (req.method === "GET") {const tags = await getTags({diff --git a/pages/api/v1/tokens/[id].ts b/pages/api/v1/tokens/[id].tsindex 7ecab61d..c4501fb8 100644--- a/pages/api/v1/tokens/[id].ts+++ b/pages/api/v1/tokens/[id].ts@@ -4,7 +4,7 @@ import deleteToken from "@/lib/api/controllers/tokens/tokenId/deleteTokenById";export default async function token(req: NextApiRequest, res: NextApiResponse) {const user = await verifyUser({ req, res });- if (!user) return res.status(401).json({ response: "Unauthorized" });+ if (!user) return;if (req.method === "DELETE") {if (process.env.NEXT_PUBLIC_DEMO === "true")diff --git a/pages/api/v1/tokens/index.ts b/pages/api/v1/tokens/index.tsindex a775d7d5..e0f75ce8 100644--- a/pages/api/v1/tokens/index.ts+++ b/pages/api/v1/tokens/index.ts@@ -8,7 +8,7 @@ export default async function tokens(res: NextApiResponse) {const user = await verifyUser({ req, res });- if (!user) return res.status(401).json({ response: "Unauthorized" });+ if (!user) return;if (req.method === "POST") {if (process.env.NEXT_PUBLIC_DEMO === "true")diff --git a/pages/api/v2/dashboard/index.ts b/pages/api/v2/dashboard/index.tsindex 3dee7d08..0cd5cd29 100644--- a/pages/api/v2/dashboard/index.ts+++ b/pages/api/v2/dashboard/index.ts@@ -8,7 +8,7 @@ export default async function dashboard(res: NextApiResponse) {const user = await verifyUser({ req, res });- if (!user) return res.status(401).json({ response: "Unauthorized" });+ if (!user) return;if (req.method === "GET") {const convertedData: LinkRequestQuery = {