@wbce-d9/api 11.0.8 → 11.1.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/dist/constants.js
CHANGED
|
@@ -56,8 +56,12 @@ export const REFRESH_COOKIE_OPTIONS = {
|
|
|
56
56
|
sameSite: env['REFRESH_TOKEN_COOKIE_SAME_SITE'] || 'strict',
|
|
57
57
|
path: '/auth',
|
|
58
58
|
};
|
|
59
|
-
const
|
|
60
|
-
|
|
59
|
+
export const REFRESH_COOKIE_CLEAR_OPTIONS = (() => {
|
|
60
|
+
const { ...rest } = REFRESH_COOKIE_OPTIONS;
|
|
61
|
+
delete rest.maxAge;
|
|
62
|
+
delete rest.expires;
|
|
63
|
+
return rest;
|
|
64
|
+
})();
|
|
61
65
|
export const GET_SET_HEADER = (cookieValue) => {
|
|
62
66
|
const domainHeader = env['REFRESH_TOKEN_COOKIE_DOMAIN'] ? ` Domain=${env['REFRESH_TOKEN_COOKIE_DOMAIN']};` : '';
|
|
63
67
|
const partitionedHeader = env['REFRESH_TOKEN_COOKIE_PARTITIONED'] == true ? ' Partitioned;' : '';
|
|
@@ -70,10 +74,14 @@ export const ACCESS_COOKIE_OPTIONS = {
|
|
|
70
74
|
maxAge: getMilliseconds(env['ACCESS_TOKEN_TTL']),
|
|
71
75
|
secure: env['ACCESS_TOKEN_COOKIE_SECURE'] ?? false,
|
|
72
76
|
sameSite: env['ACCESS_TOKEN_COOKIE_SAME_SITE'] || 'strict',
|
|
73
|
-
path: '/',
|
|
77
|
+
path: '/assets',
|
|
74
78
|
};
|
|
75
|
-
const
|
|
76
|
-
|
|
79
|
+
export const ACCESS_COOKIE_CLEAR_OPTIONS = (() => {
|
|
80
|
+
const { ...rest } = ACCESS_COOKIE_OPTIONS;
|
|
81
|
+
delete rest.maxAge;
|
|
82
|
+
delete rest.expires;
|
|
83
|
+
return rest;
|
|
84
|
+
})();
|
|
77
85
|
export const OAS_REQUIRED_SCHEMAS = ['Diff', 'Schema', 'Query', 'x-metadata'];
|
|
78
86
|
/** Formats from which transformation is supported */
|
|
79
87
|
export const SUPPORTED_IMAGE_TRANSFORM_FORMATS = ['image/jpeg', 'image/png', 'image/webp', 'image/tiff', 'image/avif'];
|
|
@@ -22,7 +22,9 @@ const extractToken = (req, _res, next) => {
|
|
|
22
22
|
/**
|
|
23
23
|
* Check if there is an access token stored in the cookies
|
|
24
24
|
*/
|
|
25
|
-
if (req?.cookies?.[env['ACCESS_TOKEN_COOKIE_NAME']]
|
|
25
|
+
if (req?.cookies?.[env['ACCESS_TOKEN_COOKIE_NAME']] &&
|
|
26
|
+
req.path.startsWith('/assets/') &&
|
|
27
|
+
req.method === 'GET') {
|
|
26
28
|
token = req.cookies[env['ACCESS_TOKEN_COOKIE_NAME']];
|
|
27
29
|
}
|
|
28
30
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wbce-d9/api",
|
|
3
|
-
"version": "11.0
|
|
3
|
+
"version": "11.1.0",
|
|
4
4
|
"description": "Directus is a real-time API and App dashboard for managing SQL database content",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -145,18 +145,18 @@
|
|
|
145
145
|
"wellknown": "0.5.0",
|
|
146
146
|
"@wbce-d9/app": "9.33.2",
|
|
147
147
|
"@wbce-d9/constants": "9.28.0",
|
|
148
|
-
"@wbce-d9/extensions-sdk": "9.27.2",
|
|
149
|
-
"@wbce-d9/exceptions": "9.26.4",
|
|
150
148
|
"@wbce-d9/schema": "9.26.4",
|
|
151
149
|
"@wbce-d9/specs": "9.26.5",
|
|
150
|
+
"@wbce-d9/exceptions": "9.26.4",
|
|
152
151
|
"@wbce-d9/storage": "9.26.4",
|
|
153
|
-
"@wbce-d9/storage-driver-cloudinary": "9.27.2",
|
|
154
|
-
"@wbce-d9/storage-driver-gcs": "9.26.9",
|
|
155
152
|
"@wbce-d9/storage-driver-azure": "9.26.9",
|
|
153
|
+
"@wbce-d9/extensions-sdk": "9.27.2",
|
|
154
|
+
"@wbce-d9/storage-driver-gcs": "9.26.9",
|
|
155
|
+
"@wbce-d9/storage-driver-s3": "9.26.11",
|
|
156
156
|
"@wbce-d9/storage-driver-local": "9.26.9",
|
|
157
|
-
"@wbce-d9/utils": "9.29.2",
|
|
158
157
|
"@wbce-d9/update-check": "9.28.0",
|
|
159
|
-
"@wbce-d9/storage-driver-
|
|
158
|
+
"@wbce-d9/storage-driver-cloudinary": "9.27.2",
|
|
159
|
+
"@wbce-d9/utils": "9.29.2"
|
|
160
160
|
},
|
|
161
161
|
"devDependencies": {
|
|
162
162
|
"@ngneat/falso": "6.4.0",
|