1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-09 12:42:36 +01:00

Improve consent cookie domain

This commit is contained in:
Hillel Coren 2018-03-29 11:11:00 +03:00
parent 8c0004b53b
commit ecb56702c3
2 changed files with 16 additions and 1 deletions

View File

@ -2,6 +2,8 @@
namespace App\Constants;
use App\Libraries\Utils;
class Domain
{
const INVOICENINJA_COM = 1;
@ -28,4 +30,17 @@ class Domain
{
return 'maildelivery@' . static::getDomainFromId($id);
}
public static function getCookieDomain($url)
{
if (! Utils::isNinjaProd() || Utils::isReseller()) {
return '';
}
if (strpos($url, '.services') !== false) {
return '.invoice.services';
} else {
return '.invoiceninja.com';
}
}
}

View File

@ -212,7 +212,7 @@
},
},
"cookie": {
"domain": "{{ config('session.domain') }}"
"domain": "{{ App\Constants\Domain::getCookieDomain(request()->url) }}"
},
"content": {
"href": "{{ Utils::isNinja() ? Utils::getPrivacyLink() : (config('ninja.privacy_policy_url') ?: 'https://cookiesandyou.com/' ) }}",