This commit is contained in:
freek 2018-11-28 21:07:07 +01:00
parent 7fdcbe13ef
commit 20991af127
1 changed files with 1 additions and 3 deletions

View File

@ -30,15 +30,13 @@ class Channel
protected function verifySignature(ConnectionInterface $connection, stdClass $payload)
{
$auth = $payload->auth;
$signature = "{$connection->socketId}:{$this->channelId}";
if (isset($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();
}
}