Improve consent cookie domain
This commit is contained in:
parent
8c0004b53b
commit
ecb56702c3
2 changed files with 16 additions and 1 deletions
|
|
@ -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';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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/' ) }}",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue