nitpick
This commit is contained in:
parent
7fdcbe13ef
commit
20991af127
|
|
@ -30,15 +30,13 @@ class Channel
|
||||||
|
|
||||||
protected function verifySignature(ConnectionInterface $connection, stdClass $payload)
|
protected function verifySignature(ConnectionInterface $connection, stdClass $payload)
|
||||||
{
|
{
|
||||||
$auth = $payload->auth;
|
|
||||||
|
|
||||||
$signature = "{$connection->socketId}:{$this->channelId}";
|
$signature = "{$connection->socketId}:{$this->channelId}";
|
||||||
|
|
||||||
if (isset($payload->channel_data)) {
|
if (isset($payload->channel_data)) {
|
||||||
$signature .= ":{$payload->channel_data}";
|
$signature .= ":{$payload->channel_data}";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (str_after($auth, ':') !== hash_hmac('sha256', $signature, $connection->client->appSecret)) {
|
if (str_after($payload->auth, ':') !== hash_hmac('sha256', $signature, $connection->client->appSecret)) {
|
||||||
throw new InvalidSignature();
|
throw new InvalidSignature();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue