Skip to content

Commit

Permalink
fix: next-auth
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <i@innei.in>
  • Loading branch information
Innei committed Oct 5, 2024
1 parent 857fc79 commit 715fcc0
Show file tree
Hide file tree
Showing 3 changed files with 1,264 additions and 1,012 deletions.
51 changes: 27 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,23 @@
"@milkdown/transformer": "7.5.0",
"@milkdown/utils": "7.5.0",
"@mx-space/api-client": "1.16.1",
"@openpanel/nextjs": "1.0.3",
"@openpanel/nextjs": "1.0.5",
"@prosemirror-adapter/react": "0.2.6",
"@radix-ui/react-avatar": "1.1.0",
"@radix-ui/react-dialog": "1.1.1",
"@radix-ui/react-dropdown-menu": "2.1.1",
"@radix-ui/react-avatar": "1.1.1",
"@radix-ui/react-dialog": "1.1.2",
"@radix-ui/react-dropdown-menu": "2.1.2",
"@radix-ui/react-label": "2.1.0",
"@radix-ui/react-scroll-area": "1.1.0",
"@radix-ui/react-select": "2.1.1",
"@radix-ui/react-switch": "1.1.0",
"@radix-ui/react-tabs": "1.1.0",
"@radix-ui/react-scroll-area": "1.2.0",
"@radix-ui/react-select": "2.1.2",
"@radix-ui/react-switch": "1.1.1",
"@radix-ui/react-tabs": "1.1.1",
"@shikijs/transformers": "1.20.0",
"@shiro/fetch": "link:./packages/fetch",
"@tanstack/query-async-storage-persister": "5.56.2",
"@tanstack/react-query": "5.56.2",
"@tanstack/react-query-devtools": "5.58.0",
"@tanstack/react-query-persist-client": "5.56.2",
"@upstash/redis": "1.34.1",
"@tanstack/query-async-storage-persister": "5.59.0",
"@tanstack/react-query": "5.59.0",
"@tanstack/react-query-devtools": "5.59.0",
"@tanstack/react-query-persist-client": "5.59.0",
"@upstash/redis": "1.34.2",
"@vercel/analytics": "1.3.1",
"@vercel/postgres": "0.10.0",
"bypass-vue-devtools": "0.0.6",
Expand All @@ -68,7 +68,7 @@
"emoji-mart": "5.6.0",
"emoji-picker-react": "4.12.0",
"foxact": "0.2.38",
"framer-motion": "11.5.4",
"framer-motion": "11.11.1",
"fuse.js": "7.0.0",
"idb-keyval": "6.2.1",
"immer": "^10.1.1",
Expand All @@ -83,14 +83,14 @@
"markdown-to-jsx": "npm:@innei/markdown-to-jsx@7.4.5-fork.4",
"marked": "14.1.2",
"medium-zoom": "1.1.0",
"mermaid": "11.2.1",
"mermaid": "11.3.0",
"nanoid": "^5.0.7",
"next": "14.2.13",
"next": "14.2.14",
"next-auth": "4.24.8",
"next-runtime-env": "3.2.2",
"next-themes": "0.3.0",
"ofetch": "1.4.0",
"openai": "4.65.0",
"openai": "4.67.1",
"pngjs": "7.0.0",
"prop-types": "15.8.1",
"qrcode.react": "3.2.0",
Expand All @@ -106,7 +106,7 @@
"rss": "1.2.2",
"server-only": "^0.0.1",
"socket.io-client": "4.8.0",
"tailwind-merge": "2.5.2",
"tailwind-merge": "2.5.3",
"unidata.js": "0.8.0",
"unified": "^11.0.5",
"uniqolor": "1.1.1",
Expand All @@ -117,11 +117,11 @@
},
"devDependencies": {
"@egoist/tailwindcss-icons": "1.8.1",
"@iconify-json/material-symbols": "1.2.1",
"@iconify-json/material-symbols": "1.2.2",
"@iconify-json/mingcute": "1.2.0",
"@innei/prettier": "0.15.0",
"@mx-space/webhook": "0.5.0",
"@next/bundle-analyzer": "14.2.13",
"@next/bundle-analyzer": "14.2.14",
"@tailwindcss/container-queries": "0.1.1",
"@tailwindcss/typography": "0.5.15",
"@types/chroma-js": "2.4.4",
Expand All @@ -131,7 +131,7 @@
"@types/markdown-escape": "1.1.3",
"@types/node": "22.7.4",
"@types/pngjs": "6.0.5",
"@types/react": "18.3.10",
"@types/react": "18.3.11",
"@types/react-dom": "18.3.0",
"@types/react-responsive-masonry": "2.1.3",
"@types/remove-markdown": "0.3.4",
Expand All @@ -141,14 +141,14 @@
"code-inspector-plugin": "0.16.1",
"cross-env": "7.0.3",
"dotenv": "16.4.5",
"eslint": "9.11.1",
"eslint-config-hyoban": "3.1.8",
"eslint": "9.12.0",
"eslint-config-hyoban": "3.1.9",
"lint-staged": "15.2.10",
"postcss": "8.4.47",
"postcss-import": "16.1.0",
"postcss-js": "4.0.1",
"postcss-nested": "6.2.0",
"postcss-preset-env": "10.0.5",
"postcss-preset-env": "10.0.6",
"postcss-prune-var": "1.1.2",
"prettier": "3.3.3",
"rimraf": "6.0.1",
Expand Down Expand Up @@ -177,6 +177,9 @@
"object.hasown": "npm:@nolyfill/object.hasown@latest",
"object.values": "npm:@nolyfill/object.values@latest",
"string.prototype.matchall": "npm:@nolyfill/string.prototype.matchall@latest"
},
"patchedDependencies": {
"next-auth": "patches/next-auth.patch"
}
},
"simple-git-hooks": {
Expand Down
41 changes: 18 additions & 23 deletions patches/next-auth.patch
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
diff --git a/client/_utils.js b/client/_utils.js
index de4e3c4eedfaffa561ff7ea80f109cbf3bb807e5..ea42a4893fbb67159663d21bd606f44eece0ebe1 100644
index 25bd573915c9bd9251ed6ce241889e0d6f13ba55..13a0976921eee51ecaab15ec062ba3ce6e8b47ce 100644
--- a/client/_utils.js
+++ b/client/_utils.js
@@ -57,6 +57,8 @@ function _fetchData() {
options.method = "POST";
}

+ options.credentials = "include";
+
_context.next = 7;
return fetch(url, options);

diff --git a/src/client/_utils.ts b/src/client/_utils.ts
index 1f3819e0db80661af241d9110aabe3e2f2520a1b..edf96089152f317a5eeb982acac3a3586f0ac3a9 100644
--- a/src/client/_utils.ts
+++ b/src/client/_utils.ts
@@ -54,7 +54,7 @@ export async function fetchData<T = any>(
if (!res.ok) throw data
return Object.keys(data).length > 0 ? data : null // Return null if data empty
} catch (error) {
- logger.error("CLIENT_FETCH_ERROR", { error: error as Error, url })
+ console.error("CLIENT_FETCH_ERROR", { error: error as Error, url })
return null
}
}
@@ -46,6 +46,7 @@ function _fetchData() {
options.method = "POST";
}
_context.next = 7;
+ options.credentials = "include";
return fetch(url, options);
case 7:
res = _context.sent;
@@ -63,7 +64,7 @@ function _fetchData() {
case 16:
_context.prev = 16;
_context.t0 = _context["catch"](2);
- logger.error("CLIENT_FETCH_ERROR", {
+ console.error("CLIENT_FETCH_ERROR", {
error: _context.t0,
url: url
});
Loading

0 comments on commit 715fcc0

Please sign in to comment.