Update Impersonate.php

This commit is contained in:
Julian Prieber 2023-07-13 18:56:23 +02:00
parent 3f62c84406
commit 166261ae31
1 changed files with 4 additions and 1 deletions

View File

@ -10,7 +10,10 @@ class Impersonate
{
public function handle($request, Closure $next)
{
$adminUser = User::whereNotNull('auth_as')->where('role', 'admin')->first();
$adminUser = User::where('role', 'admin')->where(function ($query) {
$query->where('auth_as', '!=', null)
->where('auth_as', '!=', '');
})->first();
if ($adminUser) {