Skip to content

Commit

Permalink
Fixed an issue that prevented authentication in private or presence c…
Browse files Browse the repository at this point in the history
…hannels containing the words 'private' or 'presence' in their channel names
  • Loading branch information
Joe Aliperti committed Nov 10, 2016
1 parent 57be173 commit db8dd34
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,14 @@ public function auth($request)
throw new HttpException(403);
}

if (Str::startsWith($request->channel_name, 'private-')) {
return parent::verifyUserCanAccessChannel(
$request, Str::replaceFirst('private-', '', $request->channel_name)
);
}

return parent::verifyUserCanAccessChannel(
$request, str_replace(['private-', 'presence-'], '', $request->channel_name)
$request, Str::replaceFirst('presence-', '', $request->channel_name)
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,14 @@ public function auth($request)
throw new HttpException(403);
}

if (Str::startsWith($request->channel_name, 'private-')) {
return parent::verifyUserCanAccessChannel(
$request, Str::replaceFirst('private-', '', $request->channel_name)
);
}

return parent::verifyUserCanAccessChannel(
$request, str_replace(['private-', 'presence-'], '', $request->channel_name)
$request, Str::replaceFirst('presence-', '', $request->channel_name)
);
}

Expand Down

0 comments on commit db8dd34

Please sign in to comment.