Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions dist/crowdhandler.cjs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/crowdhandler.cjs.js.map

Large diffs are not rendered by default.

15 changes: 8 additions & 7 deletions dist/crowdhandler.esm.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/crowdhandler.esm.js.map

Large diffs are not rendered by default.

15 changes: 8 additions & 7 deletions dist/crowdhandler.umd.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/crowdhandler.umd.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/crowdhandler.umd.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/crowdhandler.umd.min.js.map

Large diffs are not rendered by default.

13 changes: 7 additions & 6 deletions dist/gatekeeper/gatekeeper.js
Original file line number Diff line number Diff line change
Expand Up @@ -774,14 +774,15 @@ var Gatekeeper = /** @class */ (function () {
(0, logger_1.logger)(this.options.debug, "info", "Domain has trailing wildcard, cannot use root domain cookie");
return { isWildcard: false };
}
// Extract root domain (last two parts for cookie domain)
var parts = domainPart.split('.');
var rootDomain = parts.length >= 2
? ".".concat(parts.slice(-2).join('.'))
: ".".concat(domainPart);
// Use the full domain captured after the wildcard. The integrator's
// wildcard placement defines the cookie scope: e.g. *.barbican.org.uk
// → .barbican.org.uk, *.example.com → .example.com. Avoid heuristics
// like "last two labels", which mis-handle multi-label public suffixes
// (.co.uk, .org.uk, .com.au) and would scope the cookie to a public
// suffix the browser then rejects.
return {
isWildcard: true,
rootDomain: rootDomain
rootDomain: ".".concat(domainPart)
};
};
/**
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "crowdhandler-sdk",
"version": "2.4.0",
"version": "2.4.1",
"description": "",
"homepage": "https://www.crowdhandler.com",
"repository": {
Expand Down
14 changes: 7 additions & 7 deletions src/gatekeeper/gatekeeper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -944,15 +944,15 @@ export class Gatekeeper {
return { isWildcard: false };
}

// Extract root domain (last two parts for cookie domain)
const parts = domainPart.split('.');
const rootDomain = parts.length >= 2
? `.${parts.slice(-2).join('.')}`
: `.${domainPart}`;

// Use the full domain captured after the wildcard. The integrator's
// wildcard placement defines the cookie scope: e.g. *.barbican.org.uk
// → .barbican.org.uk, *.example.com → .example.com. Avoid heuristics
// like "last two labels", which mis-handle multi-label public suffixes
// (.co.uk, .org.uk, .com.au) and would scope the cookie to a public
// suffix the browser then rejects.
return {
isWildcard: true,
rootDomain: rootDomain
rootDomain: `.${domainPart}`
};
}

Expand Down