fix(styles): persist accent cookies on localhost
This commit is contained in:
@@ -667,7 +667,12 @@ export function renderThemeRuntime(theme: ResolvedTheme): string {
|
||||
options=options||{};
|
||||
var path=options.path||"/";
|
||||
var sameSite=options.sameSite||"Lax";
|
||||
var domain=options.domain?";domain="+options.domain:"";
|
||||
// localhost is not a registrable parent domain. Some browsers reject a
|
||||
// Domain=localhost cookie entirely, so keep it host-only in local dev.
|
||||
var configuredDomain=options.domain;
|
||||
var domain=configuredDomain&&configuredDomain!=="localhost"
|
||||
?";domain="+configuredDomain
|
||||
:"";
|
||||
var secure=options.secure===true||(options.secure!==false&&location.protocol==="https:")?";secure":"";
|
||||
return ";path="+path+";samesite="+sameSite+domain+secure;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user