adminforth 1.2.4 → 1.2.7

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.
@@ -149,11 +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
- return;
157
152
  }
158
153
  const jwt = (_a = jwts[0]) === null || _a === void 0 ? void 0 : _a.value;
159
154
  if (!jwt) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adminforth",
3
- "version": "1.2.4",
3
+ "version": "1.2.7",
4
4
  "description": "OpenSource Vue3 powered forth-generation admin panel",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -162,11 +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
- return;
170
165
  }
171
166
 
172
167
  const jwt = jwts[0]?.value;
@@ -645,7 +645,7 @@ export type BeforeLoginConfirmationFunction = (params?: {
645
645
  ok:boolean,
646
646
  error?:string,
647
647
  body: {
648
- redirectTo?: 'string',
648
+ redirectTo?: string,
649
649
  allowedLogin?: boolean,
650
650
  }
651
651
  }>;