bugfix issue#68

This commit is contained in:
2020-05-26 17:16:01 +02:00
parent 22bb46981d
commit e7c2b5b39a
4 changed files with 62 additions and 41 deletions

View File

@@ -729,10 +729,14 @@ var CookieConsent = function (_Component) {
var _props3 = this.props,
extraCookieOptions = _props3.extraCookieOptions,
expires = _props3.expires,
sameSite = _props3.sameSite,
cookieSecurity = _props3.cookieSecurity;
sameSite = _props3.sameSite;
var cookieSecurity = this.props.cookieSecurity;
if (cookieSecurity === undefined) {
cookieSecurity = location ? location.protocol === "https:" : true;
}
var cookieOptions = _extends({ expires: expires }, extraCookieOptions, { sameSite: sameSite, secure: cookieSecurity });
// Fallback for older browsers where can not set SameSite=None, SEE: https://web.dev/samesite-cookie-recipes/#handling-incompatible-clients
@@ -962,7 +966,6 @@ CookieConsent.defaultProps = {
enableDeclineButton: false,
flipButtons: false,
sameSite: SAME_SITE_OPTIONS.NONE,
cookieSecurity: location ? location.protocol === "https:" : true,
ButtonComponent: function ButtonComponent(_ref2) {
var children = _ref2.children,
props = _objectWithoutProperties(_ref2, ["children"]);