Skip to content

Commit fa03a6c

Browse files
committed
fix(insights): patch @auth/qwik
upstream is ignoring the PR
1 parent 4bb6d22 commit fa03a6c

File tree

4 files changed

+85
-46
lines changed

4 files changed

+85
-46
lines changed

Diff for: package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,8 @@
175175
"@supabase/realtime-js": "2.8.4"
176176
},
177177
"patchedDependencies": {
178-
178+
179+
"@auth/qwik": "patches/@auth__qwik.patch"
179180
}
180181
},
181182
"private": true,

Diff for: packages/insights/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "Qwik Insights dashboard",
44
"version": "0.1.0",
55
"dependencies": {
6-
"@auth/qwik": "0.2.2",
6+
"@auth/qwik": "0.6.0",
77
"@libsql/client": "^0.14.0",
88
"@modular-forms/qwik": "^0.24.0",
99
"@typescript/analyze-trace": "^0.10.1",

Diff for: patches/@auth__qwik.patch

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
diff --git a/index.qwik.js b/index.qwik.js
2+
index 344a147d81a24d041488239401b91b078b061edc..61c0c9afdd048e6befe4d142dd4def44244d9d4a 100644
3+
--- a/index.qwik.js
4+
+++ b/index.qwik.js
5+
@@ -1,7 +1,6 @@
6+
import { globalActionQrl, zodQrl, z, routeLoaderQrl } from "@builder.io/qwik-city";
7+
import { inlinedQrl, useLexicalScope, implicit$FirstArg } from "@builder.io/qwik";
8+
-import { Auth, skipCSRFCheck, isAuthAction } from "@auth/core";
9+
-import { customFetch } from "@auth/core";
10+
+import { customFetch as customFetch$1, Auth, skipCSRFCheck, isAuthAction } from "@auth/core";
11+
import { isServer } from "@builder.io/qwik/build";
12+
var setCookie = { exports: {} };
13+
var defaultParseOptions = {
14+
@@ -292,9 +291,11 @@ AccountNotLinked.type = "AccountNotLinked";
15+
class ExperimentalFeatureNotEnabled extends AuthError {
16+
}
17+
ExperimentalFeatureNotEnabled.type = "ExperimentalFeatureNotEnabled";
18+
+const customFetch = isServer ? customFetch$1 : void 0;
19+
function QwikAuthQrl(authOptions) {
20+
const useSignIn = globalActionQrl(/* @__PURE__ */ inlinedQrl(async ({ providerId, redirectTo: _redirectTo, options, authorizationParams }, req) => {
21+
const [authOptions2] = useLexicalScope();
22+
+ if (!isServer) return;
23+
const { redirectTo = _redirectTo ?? defaultRedirectTo(req), ...rest } = options ?? {};
24+
const isCredentials = providerId === "credentials";
25+
const authOpts = await authOptions2(req);
26+
@@ -325,6 +326,7 @@ function QwikAuthQrl(authOptions) {
27+
}, "QwikAuthQrl_useSignIn_globalAction_zod_X0EcrMISJRM")));
28+
const useSignOut = globalActionQrl(/* @__PURE__ */ inlinedQrl(async ({ redirectTo }, req) => {
29+
const [authOptions2] = useLexicalScope();
30+
+ if (!isServer) return;
31+
redirectTo ?? (redirectTo = defaultRedirectTo(req));
32+
const authOpts = await authOptions2(req);
33+
setEnvDefaults(req.env, authOpts);
34+
@@ -374,6 +376,7 @@ function QwikAuthQrl(authOptions) {
35+
}
36+
const QwikAuth$ = /* @__PURE__ */ implicit$FirstArg(QwikAuthQrl);
37+
async function authAction(body, req, path, authOptions) {
38+
+ if (!isServer) return;
39+
const request = new Request(new URL(path, req.request.url), {
40+
method: req.request.method,
41+
headers: req.request.headers,
42+
@@ -431,6 +434,7 @@ async function getSessionData(req, options) {
43+
throw new Error(data.message);
44+
}
45+
const setEnvDefaults = (env, config) => {
46+
+ if (!isServer) return;
47+
config.basePath = "/auth";
48+
if (!config.secret?.length) {
49+
config.secret = [];

Diff for: pnpm-lock.yaml

+33-44
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)