@zauru-sdk/services 2.8.0 → 2.10.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.
@@ -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, session) => {
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(session, {
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, session: Session) => Promise<string | null>;
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.8.0",
3
+ "version": "2.10.0",
4
4
  "description": "Servicios de consulta a Zauru",
5
5
  "main": "./dist/esm/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -27,10 +27,10 @@
27
27
  "@upstash/redis": "^1.34.5",
28
28
  "@zauru-sdk/common": "^2.7.0",
29
29
  "@zauru-sdk/config": "^2.0.220",
30
- "@zauru-sdk/graphql": "^2.4.0",
30
+ "@zauru-sdk/graphql": "^2.10.0",
31
31
  "@zauru-sdk/types": "^2.7.0",
32
32
  "axios": "^1.6.7",
33
33
  "chalk": "5.3.0"
34
34
  },
35
- "gitHead": "35b18e9cc461d742a9bf00d898f9398b862c8c7e"
35
+ "gitHead": "e8f218d534f56eff1c871f2e6c2127d6fc383240"
36
36
  }