@defra/lis-hubs-infra-access 0.22.0 → 0.23.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/package.json +1 -1
- package/src/auth/tokens/urls.js +3 -2
package/package.json
CHANGED
package/src/auth/tokens/urls.js
CHANGED
|
@@ -108,6 +108,8 @@ export function buildHubLoginUrl({ hubOrigin, returnUrl }) {
|
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
/**
|
|
111
|
+
* Assets count as public only at the start of the path - never anywhere
|
|
112
|
+
* in it, or a route such as /holdings/public/x/y would skip authentication.
|
|
111
113
|
* @param {Request} request
|
|
112
114
|
* @param {string} assetPath
|
|
113
115
|
* @returns {boolean}
|
|
@@ -117,8 +119,7 @@ export function isPublicRequest(request, assetPath) {
|
|
|
117
119
|
request.path === '/favicon.ico' ||
|
|
118
120
|
request.path === '/health' ||
|
|
119
121
|
request.path === assetPath ||
|
|
120
|
-
request.path.startsWith(`${assetPath}/`)
|
|
121
|
-
request.path.includes(`${assetPath}/`)
|
|
122
|
+
request.path.startsWith(`${assetPath}/`)
|
|
122
123
|
)
|
|
123
124
|
}
|
|
124
125
|
|