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:
parent
0d86776bc5
commit
93de597a27
@ -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';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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/' ) }}",
|
||||
|
Loading…
Reference in New Issue
Block a user