Skip to content

⚡️⚡️⚡️ Self-hosted collaborative bookmark manager to collect, read, annotate, and fully preserve what matters, all in one place.

bug fixed

daniel31x13c8c8fb7875fd
diff --git a/apps/mobile/app/links/[id].tsx b/apps/mobile/app/links/[id].tsx
index 0d9048e4..a3bc6d0d 100644
--- a/apps/mobile/app/links/[id].tsx
+++ b/apps/mobile/app/links/[id].tsx
@@ -69,7 +69,7 @@ export default function LinkScreen() {
}
}
- if (user && user[0]?.id && !url) {
+ if (user && user.id && !url) {
loadCacheOrFetch();
}
}, [user, url]);
@@ -92,8 +92,10 @@ export default function LinkScreen() {
} finally {
setIsLoading(false);
}
- } else if (link?.id && !format) {
- setUrl(generateLinkHref(link, user[0], auth.instance, true));
+ } else if (link?.id && !format && user) {
+ setUrl(
+ generateLinkHref(link, { ...user, password: "" }, auth.instance, true)
+ );
} else if (link?.id && format) {
setUrl(`${auth.instance}/api/v1/archives/${link.id}?format=${format}`);
}
diff --git a/apps/mobile/ios/Podfile.lock b/apps/mobile/ios/Podfile.lock
index 4d08e190..fbf33263 100644
--- a/apps/mobile/ios/Podfile.lock
+++ b/apps/mobile/ios/Podfile.lock
@@ -275,9 +275,9 @@ PODS:
- FBLazyVector (0.76.9)
- fmt (11.0.2)
- glog (0.3.5)
- - hermes-engine (0.76.5):
- - hermes-engine/Pre-built (= 0.76.5)
- - hermes-engine/Pre-built (0.76.5)
+ - hermes-engine (0.76.9):
+ - hermes-engine/Pre-built (= 0.76.9)
+ - hermes-engine/Pre-built (0.76.9)
- RCT-Folly (2024.10.14.00):
- boost
- DoubleConversion
@@ -2502,7 +2502,7 @@ SPEC CHECKSUMS:
FBLazyVector: 7605ea4810e0e10ae4815292433c09bf4324ba45
fmt: 01b82d4ca6470831d1cc0852a1af644be019e8f6
glog: 08b301085f15bcbb6ff8632a8ebaf239aae04e6a
- hermes-engine: 06a9c6900587420b90accc394199527c64259db4
+ hermes-engine: 9e868dc7be781364296d6ee2f56d0c1a9ef0bb11
RCT-Folly: 7b4f73a92ad9571b9dbdb05bb30fad927fa971e1
RCTDeprecation: ebe712bb05077934b16c6bf25228bdec34b64f83
RCTRequired: ca91e5dd26b64f577b528044c962baf171c6b716
diff --git a/apps/web/pages/api/v1/users/me.ts b/apps/web/pages/api/v1/users/me.ts
new file mode 100644
index 00000000..549be960
--- /dev/null
+++ b/apps/web/pages/api/v1/users/me.ts
@@ -0,0 +1,19 @@
+import type { NextApiRequest, NextApiResponse } from "next";
+import getUserById from "@/lib/api/controllers/users/userId/getUserById";
+import verifyToken from "@/lib/api/verifyToken";
+
+export default async function me(req: NextApiRequest, res: NextApiResponse) {
+ const token = await verifyToken({ req });
+
+ if (typeof token === "string") {
+ res.status(401).json({ response: token });
+ return null;
+ }
+
+ const userId = token.id;
+
+ if (req.method === "GET") {
+ const users = await getUserById(userId);
+ return res.status(users.status).json({ response: users.response });
+ }
+}
diff --git a/packages/router/user.tsx b/packages/router/user.tsx
index 7ee1ab5e..0bb1723f 100644
--- a/packages/router/user.tsx
+++ b/packages/router/user.tsx
@@ -20,10 +20,9 @@ const useUser = (auth?: MobileAuth) => {
status = auth.status;
}
- const url =
- (auth?.instance ? auth?.instance : "") +
- "/api/v1/users" +
- (userId ? `/${userId}` : "");
+ const url = auth
+ ? auth?.instance + "/api/v1/users/me"
+ : "/api/v1/users/" + userId;
return useQuery({
queryKey: ["user"],
@@ -54,7 +53,8 @@ const useUser = (auth?: MobileAuth) => {
dashboardSections: DashboardSection[];
};
- document.querySelector("html")?.setAttribute("data-theme", data.theme);
+ if (!auth)
+ document.querySelector("html")?.setAttribute("data-theme", data.theme);
return data;
},