casdoor 1.5.0 → 1.5.1
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/match.js +4 -2
package/package.json
CHANGED
package/src/match.js
CHANGED
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
// limitations under the License.
|
|
14
14
|
|
|
15
15
|
// The sign-in page patterns of form autofill, matched the same way as Casdoor matches them (object/form_fill.go):
|
|
16
|
-
// the host has to be the same, "*.example.com" covers the subdomains,
|
|
16
|
+
// the host has to be the same, "*.example.com" covers the subdomains, a path without "*" is a prefix, and the part
|
|
17
|
+
// after "#" is compared only when the pattern has it.
|
|
17
18
|
|
|
18
19
|
function splitFormFillUrl(value) {
|
|
19
20
|
value = (value || "").trim();
|
|
@@ -66,7 +67,8 @@ function matchFormFillUrl(pattern, pageUrl) {
|
|
|
66
67
|
if (!matchFormFillHost(patternHost, pageHost)) {
|
|
67
68
|
return false;
|
|
68
69
|
}
|
|
69
|
-
|
|
70
|
+
// the fragment only counts when the pattern has one, like the "#/login" route of a single-page application
|
|
71
|
+
const pagePath = patternPath.includes("#") ? fullPagePath : fullPagePath.split("#")[0];
|
|
70
72
|
if (!patternPath.includes("*")) {
|
|
71
73
|
return pagePath.startsWith(patternPath);
|
|
72
74
|
}
|