Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/Illuminate/Broadcasting/Broadcasters/Broadcaster.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Illuminate\Contracts\Routing\UrlRoutable;
use Illuminate\Support\Arr;
use Illuminate\Support\Reflector;
use Illuminate\Support\Facades\App;
use ReflectionClass;
use ReflectionFunction;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
Expand Down Expand Up @@ -119,13 +120,21 @@ protected function verifyUserCanAccessChannel($request, $channel)
$result = $handler($this->retrieveUser($request, $channel), ...$parameters);

if ($result === false) {
throw new AccessDeniedHttpException;
if (App::environment('production')) {
throw new AccessDeniedHttpException;
} else {
throw new AccessDeniedHttpException('User does not have access to this channel.');
}
} elseif ($result) {
return $this->validAuthenticationResponse($request, $result);
}
}

throw new AccessDeniedHttpException;
if (App::environment('production')) {
throw new AccessDeniedHttpException;
} else {
throw new AccessDeniedHttpException('No matching pattern found or user authentication failed.');
}
}

/**
Expand Down
Loading