@dnax/core 0.37.0 → 0.38.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/app/hono.ts CHANGED
@@ -131,6 +131,7 @@ function HonoInstance(): typeof app {
131
131
  state: sessionData?.state || {},
132
132
  role: sessionData?.role || null,
133
133
  _v: { ...(_v || {}) },
134
+ isAuth: valid ? true : false,
134
135
  });
135
136
  } else {
136
137
  // no valid token
@@ -139,6 +140,7 @@ function HonoInstance(): typeof app {
139
140
  state: {},
140
141
  role: undefined,
141
142
  _v: { ...(_v || {}) },
143
+ isAuth: false,
142
144
  });
143
145
  }
144
146
 
@@ -22,9 +22,14 @@ function isSetAsyncLocalStorage() {
22
22
  const sessionStorage = () => ({
23
23
  get(): {
24
24
  state: object;
25
- _v: object;
25
+ _v: {
26
+ isAuth: boolean;
27
+ reqAt?: string;
28
+ setAt?: string;
29
+ };
26
30
  role: string | null | undefined;
27
31
  token?: string;
32
+ isAuth?: boolean;
28
33
  } {
29
34
  if (!isSetAsyncLocalStorage()) return { state: {}, _v: {}, role: null };
30
35
  let store = asyncLocalStorage?.getStore() as InstanceType<typeof Map>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dnax/core",
3
- "version": "0.37.0",
3
+ "version": "0.38.0",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "bin": {
package/types/index.ts CHANGED
@@ -171,18 +171,30 @@ export type sessionCtx = {
171
171
  user?: object;
172
172
  };
173
173
  token?: string;
174
- _v?: object;
174
+ _v?: {
175
+ ip: string;
176
+ isAuth: boolean;
177
+ reqAt?: string;
178
+ setAt?: string;
179
+ };
175
180
  role?: string | null | undefined;
176
181
  expiresIn?: string;
182
+ isAuth?: boolean;
177
183
  }) => void;
178
184
  get: () => {
179
185
  state: {
180
186
  [key: string]: any;
181
187
  user?: object;
182
188
  };
183
- _v: object;
189
+ _v: {
190
+ ip: string;
191
+ isAuth: boolean;
192
+ reqAt?: string;
193
+ setAt?: string;
194
+ };
184
195
  role: string | null | undefined;
185
196
  token: string | null | undefined;
197
+ isAuth: boolean;
186
198
  };
187
199
  };
188
200