adminforth 1.2.3 → 1.2.4
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/index.js +3 -2
- package/dist/servers/express.js +1 -0
- package/index.ts +7 -14
- package/package.json +1 -1
- package/servers/express.ts +1 -0
package/dist/index.js
CHANGED
|
@@ -20,11 +20,12 @@ import SQLiteConnector from './dataConnectors/sqlite.js';
|
|
|
20
20
|
import CodeInjector from './modules/codeInjector.js';
|
|
21
21
|
import ExpressServer from './servers/express.js';
|
|
22
22
|
import { ADMINFORTH_VERSION, listify } from './modules/utils.js';
|
|
23
|
-
import { AdminForthFilterOperators, AdminForthDataTypes, AdminForthResourcePages } from './types/AdminForthConfig.js';
|
|
23
|
+
import { AdminForthFilterOperators, AdminForthDataTypes, AdminForthResourcePages, } from './types/AdminForthConfig.js';
|
|
24
24
|
import AdminForthPlugin from './basePlugin.js';
|
|
25
25
|
import ConfigValidator from './modules/configValidator.js';
|
|
26
26
|
import AdminForthRestAPI from './modules/restApi.js';
|
|
27
|
-
//
|
|
27
|
+
// exports
|
|
28
|
+
export * from './types/AdminForthConfig.js';
|
|
28
29
|
export { AdminForthPlugin };
|
|
29
30
|
class AdminForth {
|
|
30
31
|
constructor(config) {
|
package/dist/servers/express.js
CHANGED
|
@@ -153,6 +153,7 @@ class ExpressServer {
|
|
|
153
153
|
res.setHeader('Set-Cookie', `${key}=; HttpOnly; SameSite=Strict; Expires=${new Date(0).toUTCString()}`);
|
|
154
154
|
});
|
|
155
155
|
res.status(401).send(`Unauthorized by AdminForth. Too many JWT cookies found (${jwts.length} instead of 1). Expected to get only one cookie with name 'adminforth_jwt'.`);
|
|
156
|
+
return;
|
|
156
157
|
}
|
|
157
158
|
const jwt = (_a = jwts[0]) === null || _a === void 0 ? void 0 : _a.value;
|
|
158
159
|
if (!jwt) {
|
package/index.ts
CHANGED
|
@@ -5,30 +5,23 @@ import PostgresConnector from './dataConnectors/postgres.js';
|
|
|
5
5
|
import SQLiteConnector from './dataConnectors/sqlite.js';
|
|
6
6
|
import CodeInjector from './modules/codeInjector.js';
|
|
7
7
|
import ExpressServer from './servers/express.js';
|
|
8
|
-
import {v1 as uuid} from 'uuid';
|
|
9
|
-
import fs from 'fs';
|
|
10
8
|
import { ADMINFORTH_VERSION, listify } from './modules/utils.js';
|
|
11
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
type AdminForthConfig,
|
|
11
|
+
type IAdminForth,
|
|
12
|
+
type IConfigValidator,
|
|
12
13
|
AdminForthFilterOperators, AdminForthDataTypes, AdminForthResourcePages, IHttpServer,
|
|
13
14
|
BeforeSaveFunction,
|
|
14
15
|
AfterSaveFunction,
|
|
15
|
-
|
|
16
|
-
AfterDataSourceResponseFunction, AllowedActionValue, AdminUser,
|
|
16
|
+
AdminUser,
|
|
17
17
|
AdminForthResource,
|
|
18
|
-
AllowedActionsEnum,
|
|
19
|
-
AllowedActions,
|
|
20
|
-
ActionCheckSource,
|
|
21
|
-
IAdminForthDataSourceConnector,
|
|
22
|
-
BeforeLoginConfirmationFunction
|
|
23
18
|
} from './types/AdminForthConfig.js';
|
|
24
|
-
import path from 'path';
|
|
25
19
|
import AdminForthPlugin from './basePlugin.js';
|
|
26
20
|
import ConfigValidator from './modules/configValidator.js';
|
|
27
21
|
import AdminForthRestAPI from './modules/restApi.js';
|
|
28
22
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
23
|
+
// exports
|
|
24
|
+
export * from './types/AdminForthConfig.js';
|
|
32
25
|
export { AdminForthPlugin };
|
|
33
26
|
|
|
34
27
|
|
package/package.json
CHANGED
package/servers/express.ts
CHANGED
|
@@ -166,6 +166,7 @@ class ExpressServer implements IExpressHttpServer {
|
|
|
166
166
|
res.setHeader('Set-Cookie', `${key}=; HttpOnly; SameSite=Strict; Expires=${new Date(0).toUTCString()}`);
|
|
167
167
|
});
|
|
168
168
|
res.status(401).send(`Unauthorized by AdminForth. Too many JWT cookies found (${jwts.length} instead of 1). Expected to get only one cookie with name 'adminforth_jwt'.`);
|
|
169
|
+
return;
|
|
169
170
|
}
|
|
170
171
|
|
|
171
172
|
const jwt = jwts[0]?.value;
|