@clerk/shared
Version:
Internal package utils used by the Clerk SDKs
37 lines (35 loc) • 1.08 kB
JavaScript
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
//#region src/internal/clerk-js/thirdPartyDomains.ts
/**
* Domains of third-party embedding platforms (e.g. online IDEs, preview environments)
* that require special handling for cookies and OAuth flows.
*
* These domains need:
* - `SameSite=None` on cookies to function correctly
* - Popup-based OAuth flows instead of redirects
*/
const THIRD_PARTY_COOKIE_DOMAINS = [
".lovable.app",
".lovableproject.com",
".webcontainer-api.io",
".vusercontent.net",
".v0.dev",
".v0.app",
".lp.dev",
".replit.dev"
];
/**
* Returns `true` if the current origin belongs to a known third-party
* embedding platform that requires `SameSite=None` on cookies.
*/
function isThirdPartyCookieDomain() {
try {
return THIRD_PARTY_COOKIE_DOMAINS.some((domain) => window.location.hostname.endsWith(domain));
} catch {
return false;
}
}
//#endregion
exports.THIRD_PARTY_COOKIE_DOMAINS = THIRD_PARTY_COOKIE_DOMAINS;
exports.isThirdPartyCookieDomain = isThirdPartyCookieDomain;
//# sourceMappingURL=thirdPartyDomains.js.map