adminforth 1.2.3 → 1.2.5
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 +0 -4
- package/index.ts +7 -14
- package/package.json +1 -1
- package/servers/express.ts +0 -4
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
|
@@ -149,10 +149,6 @@ class ExpressServer {
|
|
|
149
149
|
const jwts = cookies.filter(({ key }) => key === 'adminforth_jwt');
|
|
150
150
|
if (jwts.length > 1) {
|
|
151
151
|
console.error('Multiple adminforth_jwt cookies provided');
|
|
152
|
-
jwts.forEach(({ key }) => {
|
|
153
|
-
res.setHeader('Set-Cookie', `${key}=; HttpOnly; SameSite=Strict; Expires=${new Date(0).toUTCString()}`);
|
|
154
|
-
});
|
|
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
152
|
}
|
|
157
153
|
const jwt = (_a = jwts[0]) === null || _a === void 0 ? void 0 : _a.value;
|
|
158
154
|
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
|
@@ -162,10 +162,6 @@ class ExpressServer implements IExpressHttpServer {
|
|
|
162
162
|
const jwts = cookies.filter(({key}) => key === 'adminforth_jwt');
|
|
163
163
|
if (jwts.length > 1) {
|
|
164
164
|
console.error('Multiple adminforth_jwt cookies provided');
|
|
165
|
-
jwts.forEach(({key}) => {
|
|
166
|
-
res.setHeader('Set-Cookie', `${key}=; HttpOnly; SameSite=Strict; Expires=${new Date(0).toUTCString()}`);
|
|
167
|
-
});
|
|
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
165
|
}
|
|
170
166
|
|
|
171
167
|
const jwt = jwts[0]?.value;
|