🐛 Global privacy and api

This commit is contained in:
MarceauKa 2019-08-27 18:03:29 +02:00
parent 3b85083794
commit 72997fd3b5
1 changed files with 9 additions and 5 deletions

View File

@ -14,11 +14,15 @@ class CheckForGlobalPrivacy
public function handle($request, Closure $next)
{
if (
$request->user()
|| false === $this->globalPrivacyEnabled()
|| $this->inExceptArray($request)
) {
$user = null;
foreach (['web', 'api'] as $guard) {
if (! $user) {
$user = auth($guard)->user();
}
}
if ($user || false === $this->globalPrivacyEnabled() || $this->inExceptArray($request)) {
return $next($request);
}