@zauru-sdk/services 2.8.0 → 2.9.0
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.
package/dist/esm/common.js
CHANGED
|
@@ -125,7 +125,13 @@ async function getGraphQLToken(session) {
|
|
|
125
125
|
});
|
|
126
126
|
if (responseToken.data) {
|
|
127
127
|
session.set("graphqlToken", responseToken.data);
|
|
128
|
-
await commitSession(session
|
|
128
|
+
await commitSession(session, {
|
|
129
|
+
maxAge: 60 * 60 * 24,
|
|
130
|
+
path: "/",
|
|
131
|
+
sameSite: process.env.NODE_ENV === "production" ? "none" : "lax",
|
|
132
|
+
httpOnly: true,
|
|
133
|
+
secure: process.env.NODE_ENV === "production",
|
|
134
|
+
});
|
|
129
135
|
console.log(chalk.green(`=============== ✅ TOKEN GRAPHQL GUARDADO EN SESION Y DEVUELTO ✅ ====================`));
|
|
130
136
|
return responseToken.data;
|
|
131
137
|
}
|
|
@@ -10,14 +10,14 @@ const sessionCookie = createCookie("_rj_session", {
|
|
|
10
10
|
secure: process.env.NODE_ENV === "production",
|
|
11
11
|
});
|
|
12
12
|
const { getSession, commitSession, destroySession } = createUpstashSessionStorage({ cookie: sessionCookie });
|
|
13
|
-
const getRefreshSession = async (request
|
|
13
|
+
const getRefreshSession = async (request) => {
|
|
14
14
|
try {
|
|
15
15
|
const cookie = request.headers.get("Cookie");
|
|
16
16
|
const currentSession = await getSession(cookie);
|
|
17
17
|
if (!currentSession) {
|
|
18
18
|
return null;
|
|
19
19
|
}
|
|
20
|
-
return await commitSession(
|
|
20
|
+
return await commitSession(currentSession, {
|
|
21
21
|
maxAge: 60 * 60 * 24,
|
|
22
22
|
path: "/",
|
|
23
23
|
sameSite: process.env.NODE_ENV === "production" ? "none" : "lax",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Session } from "@remix-run/node";
|
|
2
2
|
declare const getSession: (cookieHeader?: string | null, options?: import("cookie").CookieParseOptions) => Promise<Session<import("@remix-run/node").SessionData, import("@remix-run/node").SessionData>>, commitSession: (session: Session<import("@remix-run/node").SessionData, import("@remix-run/node").SessionData>, options?: import("cookie").CookieSerializeOptions) => Promise<string>, destroySession: (session: Session<import("@remix-run/node").SessionData, import("@remix-run/node").SessionData>, options?: import("cookie").CookieSerializeOptions) => Promise<string>;
|
|
3
|
-
declare const getRefreshSession: (request: Request
|
|
3
|
+
declare const getRefreshSession: (request: Request) => Promise<string | null>;
|
|
4
4
|
export { getSession, commitSession, destroySession, getRefreshSession };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zauru-sdk/services",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.0",
|
|
4
4
|
"description": "Servicios de consulta a Zauru",
|
|
5
5
|
"main": "./dist/esm/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"axios": "^1.6.7",
|
|
33
33
|
"chalk": "5.3.0"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "cf95305196feb20a74272b90a2ad90abbbf5057b"
|
|
36
36
|
}
|