1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00

Improve consent cookie domain

This commit is contained in:
Hillel Coren 2018-03-29 11:11:32 +03:00
parent 0d86776bc5
commit 93de597a27
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

@ -219,7 +219,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/' ) }}",