Skip to content

Commit cbbd370

Browse files
committed
Add a second check here *just* to make sure someone doesn't break this.
1 parent cd0a45a commit cbbd370

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

app/Models/Server.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ class Server extends Model
113113
*/
114114
public static function byUuid($uuid)
115115
{
116+
if (! Auth::check()) {
117+
throw new \Exception('You must call Server:byUuid as an authenticated user.');
118+
}
119+
116120
// Results are cached because we call this functions a few times on page load.
117121
$result = Cache::tags(['Model:Server', 'Model:Server:byUuid:' . $uuid])->remember('Model:Server:byUuid:' . $uuid . Auth::user()->uuid, Carbon::now()->addMinutes(15), function () use ($uuid) {
118122
$query = self::with('service', 'node')->where(function ($q) use ($uuid) {

0 commit comments

Comments
 (0)