Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.3] json_decodes Pusher message from validAuthentiactoinResponse #15262

Merged
merged 3 commits into from
Sep 5, 2016
Merged
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
20 changes: 17 additions & 3 deletions src/Illuminate/Broadcasting/Broadcasters/PusherBroadcaster.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,13 @@ public function auth($request)
public function validAuthenticationResponse($request, $result)
{
if (Str::startsWith($request->channel_name, 'private')) {
return $this->pusher->socket_auth($request->channel_name, $request->socket_id);
return $this->decodedPusherResponse(
$this->pusher->socket_auth($request->channel_name, $request->socket_id)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Misspelled Response.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BrandonSurowiec thanks. Fixed in 487e985.

);
} else {
return $this->pusher->presence_auth(
$request->channel_name, $request->socket_id, $request->user()->id, $result
return $this->decodedPusherResponse(
$this->pusher->presence_auth(
$request->channel_name, $request->socket_id, $request->user()->id, $result)
);
}
}
Expand Down Expand Up @@ -88,4 +91,15 @@ public function getPusher()
{
return $this->pusher;
}

/**
* Decoded PusherResponse.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing newline.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GrahamCampbell thanks.

*
* @param mixed $response
* @return array
*/
public function decodedPusherResponse($response)
{
return json_decode($response, true);
}
}