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.
package/dist/servers/express.js
CHANGED
|
@@ -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
package/servers/express.ts
CHANGED
|
@@ -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;
|