Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

dashboard-next/api: requireUser returns never-resolving promise on redirect

nirholasb9f91e3ddce5
diff --git a/src/dashboard-next/api.js b/src/dashboard-next/api.js
index 9690baa35..c9c17a7ef 100644
--- a/src/dashboard-next/api.js
+++ b/src/dashboard-next/api.js
@@ -84,15 +84,17 @@ export function getMe() {
return mePromise;
}
-/** Redirect to /login if the user isn't signed in. Returns the user record. */
+/** Redirect to /login if the user isn't signed in. Returns the user record.
+ * When the session is missing this kicks off navigation to /login and then
+ * returns a never-resolving promise — callers `await` it and naturally halt
+ * while the browser unloads, instead of throwing an uncaught "redirecting"
+ * error that pollutes the console and Sentry. */
export async function requireUser() {
const me = await getMe();
- if (!me) {
- const ret = encodeURIComponent(location.pathname + location.search);
- location.href = `/login?return=${ret}`;
- throw new Error('redirecting');
- }
- return me;
+ if (me) return me;
+ const ret = encodeURIComponent(location.pathname + location.search);
+ location.href = `/login?return=${ret}`;
+ return new Promise(() => {});
}
// ── Small UI helpers used across pages ────────────────────────────────────