Attach user to cache to prevent showing servers they can't access.
This commit is contained in:
parent
911434d033
commit
f91e4c511e
3 changed files with 8 additions and 3 deletions
|
@ -24,6 +24,7 @@
|
|||
|
||||
namespace Pterodactyl\Observers;
|
||||
|
||||
use Auth;
|
||||
use Cache;
|
||||
use Carbon;
|
||||
use Pterodactyl\Events;
|
||||
|
@ -141,8 +142,8 @@ class ServerObserver
|
|||
public function updated(Server $server)
|
||||
{
|
||||
// Clear Caches
|
||||
Cache::forget('Server.byUuid.' . $server->uuid);
|
||||
Cache::forget('Server.byUuid.' . $server->uuidShort);
|
||||
Cache::forget('Server.byUuid.' . $server->uuid . Auth::user()->uuid);
|
||||
Cache::forget('Server.byUuid.' . $server->uuidShort . Auth::user()->uuid);
|
||||
|
||||
event(new Events\Server\Updated($server));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue