Skip to content

Commit 9f9be6a

Browse files
authored
Merge pull request #145 from ericmarcos/master
Fix AuthenticationClient for encrypted channels
2 parents 94a9aa8 + 6c20ccd commit 9f9be6a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pusher/authentication_client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
from pusher.util import (
1919
ensure_text,
20+
ensure_binary,
2021
validate_channel,
2122
validate_socket_id,
2223
channel_name_re
@@ -76,7 +77,8 @@ def authenticate(self, channel, socket_id, custom_data=None):
7677
response_payload = { "auth": auth }
7778

7879
if is_encrypted_channel(channel):
79-
shared_secret = generate_shared_secret(channel, self._encryption_master_key)
80+
shared_secret = generate_shared_secret(
81+
ensure_binary(channel, "channel"), self._encryption_master_key)
8082
shared_secret_b64 = base64.b64encode(shared_secret)
8183
response_payload["shared_secret"] = shared_secret_b64
8284

0 commit comments

Comments
 (0)