@dnax/core 0.38.0 → 0.40.1
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/lib/asyncLocalStorage.ts +2 -1
- package/package.json +1 -1
- package/types/index.ts +1 -7
package/lib/asyncLocalStorage.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { sessionCtx } from "../types";
|
|
|
3
3
|
import { localSession } from "./session";
|
|
4
4
|
import { v4 } from "uuid";
|
|
5
5
|
import { jwt } from "../utils";
|
|
6
|
+
import { Cfg } from "../config";
|
|
6
7
|
const asyncLocalStorage = new AsyncLocalStorage();
|
|
7
8
|
const key = "___sessionStorage___";
|
|
8
9
|
const stateKey = "____requestState____";
|
|
@@ -92,7 +93,7 @@ const sessionStorage = () => ({
|
|
|
92
93
|
},
|
|
93
94
|
},
|
|
94
95
|
{
|
|
95
|
-
expiresIn: input?.expiresIn || "7d",
|
|
96
|
+
expiresIn: input?.expiresIn || Cfg?.server?.jwt?.secret || "7d",
|
|
96
97
|
}
|
|
97
98
|
);
|
|
98
99
|
|
package/package.json
CHANGED
package/types/index.ts
CHANGED
|
@@ -171,15 +171,8 @@ export type sessionCtx = {
|
|
|
171
171
|
user?: object;
|
|
172
172
|
};
|
|
173
173
|
token?: string;
|
|
174
|
-
_v?: {
|
|
175
|
-
ip: string;
|
|
176
|
-
isAuth: boolean;
|
|
177
|
-
reqAt?: string;
|
|
178
|
-
setAt?: string;
|
|
179
|
-
};
|
|
180
174
|
role?: string | null | undefined;
|
|
181
175
|
expiresIn?: string;
|
|
182
|
-
isAuth?: boolean;
|
|
183
176
|
}) => void;
|
|
184
177
|
get: () => {
|
|
185
178
|
state: {
|
|
@@ -191,6 +184,7 @@ export type sessionCtx = {
|
|
|
191
184
|
isAuth: boolean;
|
|
192
185
|
reqAt?: string;
|
|
193
186
|
setAt?: string;
|
|
187
|
+
token?: string;
|
|
194
188
|
};
|
|
195
189
|
role: string | null | undefined;
|
|
196
190
|
token: string | null | undefined;
|