@cabin-id/nextjs 0.2.4 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -19,8 +19,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
19
19
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
20
|
var initial_exports = {};
|
|
21
21
|
__export(initial_exports, {
|
|
22
|
-
initialState: () => initialState
|
|
23
|
-
injectSSRStateIntoObject: () => injectSSRStateIntoObject
|
|
22
|
+
initialState: () => initialState
|
|
24
23
|
});
|
|
25
24
|
module.exports = __toCommonJS(initial_exports);
|
|
26
25
|
var import_headers = require("next/headers");
|
|
@@ -39,13 +38,8 @@ const initialState = async () => {
|
|
|
39
38
|
user
|
|
40
39
|
};
|
|
41
40
|
};
|
|
42
|
-
const injectSSRStateIntoObject = (obj, authObject) => {
|
|
43
|
-
const __clerk_ssr_state = process.env.NODE_ENV !== "production" ? JSON.parse(JSON.stringify({ ...authObject })) : { ...authObject };
|
|
44
|
-
return { ...obj, __clerk_ssr_state };
|
|
45
|
-
};
|
|
46
41
|
// Annotate the CommonJS export names for ESM import in node:
|
|
47
42
|
0 && (module.exports = {
|
|
48
|
-
initialState
|
|
49
|
-
injectSSRStateIntoObject
|
|
43
|
+
initialState
|
|
50
44
|
});
|
|
51
45
|
//# sourceMappingURL=initial.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/initial.ts"],"sourcesContent":["'use server';\n\nimport { cookies } from 'next/headers';\nimport { constants } from '../constants';\nimport { client } from './http';\n\nexport const initialState = async () => {\n const cookiesStore = cookies();\n const userId = cookiesStore.get(constants.Cookies.User)?.value || null;\n let user = null;\n\n if (userId) {\n user = await client.users.getUser(userId);\n }\n\n return {\n userId,\n user,\n };\n};\n
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/initial.ts"],"sourcesContent":["'use server';\n\nimport { cookies } from 'next/headers';\nimport { constants } from '../constants';\nimport { client } from './http';\n\nexport const initialState = async () => {\n const cookiesStore = cookies();\n const userId = cookiesStore.get(constants.Cookies.User)?.value || null;\n let user = null;\n\n if (userId) {\n user = await client.users.getUser(userId);\n }\n\n return {\n userId,\n user,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,qBAAwB;AACxB,uBAA0B;AAC1B,kBAAuB;AAEhB,MAAM,eAAe,YAAY;AANxC;AAOE,QAAM,mBAAe,wBAAQ;AAC7B,QAAM,WAAS,kBAAa,IAAI,2BAAU,QAAQ,IAAI,MAAvC,mBAA0C,UAAS;AAClE,MAAI,OAAO;AAEX,MAAI,QAAQ;AACV,WAAO,MAAM,mBAAO,MAAM,QAAQ,MAAM;AAAA,EAC1C;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
|
|
@@ -15,12 +15,7 @@ const initialState = async () => {
|
|
|
15
15
|
user
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
|
-
const injectSSRStateIntoObject = (obj, authObject) => {
|
|
19
|
-
const __clerk_ssr_state = process.env.NODE_ENV !== "production" ? JSON.parse(JSON.stringify({ ...authObject })) : { ...authObject };
|
|
20
|
-
return { ...obj, __clerk_ssr_state };
|
|
21
|
-
};
|
|
22
18
|
export {
|
|
23
|
-
initialState
|
|
24
|
-
injectSSRStateIntoObject
|
|
19
|
+
initialState
|
|
25
20
|
};
|
|
26
21
|
//# sourceMappingURL=initial.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/initial.ts"],"sourcesContent":["'use server';\n\nimport { cookies } from 'next/headers';\nimport { constants } from '../constants';\nimport { client } from './http';\n\nexport const initialState = async () => {\n const cookiesStore = cookies();\n const userId = cookiesStore.get(constants.Cookies.User)?.value || null;\n let user = null;\n\n if (userId) {\n user = await client.users.getUser(userId);\n }\n\n return {\n userId,\n user,\n };\n};\n
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/initial.ts"],"sourcesContent":["'use server';\n\nimport { cookies } from 'next/headers';\nimport { constants } from '../constants';\nimport { client } from './http';\n\nexport const initialState = async () => {\n const cookiesStore = cookies();\n const userId = cookiesStore.get(constants.Cookies.User)?.value || null;\n let user = null;\n\n if (userId) {\n user = await client.users.getUser(userId);\n }\n\n return {\n userId,\n user,\n };\n};\n"],"mappings":";AAEA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAC1B,SAAS,cAAc;AAEhB,MAAM,eAAe,YAAY;AANxC;AAOE,QAAM,eAAe,QAAQ;AAC7B,QAAM,WAAS,kBAAa,IAAI,UAAU,QAAQ,IAAI,MAAvC,mBAA0C,UAAS;AAClE,MAAI,OAAO;AAEX,MAAI,QAAQ;AACV,WAAO,MAAM,OAAO,MAAM,QAAQ,MAAM;AAAA,EAC1C;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
|
|
@@ -2,7 +2,4 @@ export declare const initialState: () => Promise<{
|
|
|
2
2
|
userId: string | null;
|
|
3
3
|
user: import("../types").User | null;
|
|
4
4
|
}>;
|
|
5
|
-
export declare const injectSSRStateIntoObject: <O, T>(obj: O, authObject: T) => O & {
|
|
6
|
-
__clerk_ssr_state: T;
|
|
7
|
-
};
|
|
8
5
|
//# sourceMappingURL=initial.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initial.d.ts","sourceRoot":"","sources":["../../../src/utils/initial.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,YAAY;;;EAaxB,CAAC
|
|
1
|
+
{"version":3,"file":"initial.d.ts","sourceRoot":"","sources":["../../../src/utils/initial.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,YAAY;;;EAaxB,CAAC"}
|