Skip to content

Commit 930b08d

Browse files
Merge pull request #27 from marcgibbons/master
Fix: Support PyJWT 2 and up
2 parents dfdbc6e + c134526 commit 930b08d

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

pusher_push_notifications/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,8 @@ def generate_token(self, user_id):
391391
},
392392
self.secret_key,
393393
algorithm='HS256',
394-
).decode('utf-8')
394+
)
395+
token = six.ensure_text(token)
395396

396397
return {
397398
'token': token,

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
six>1.4.0,<2
22
requests>2.5.0,<3
3-
pyjwt>1.1.0,<2
3+
pyjwt>1.1.0,<3

tests/test_users.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def test_generate_token_should_return_token(self):
3636
decoded_token = jwt.decode(
3737
token_string,
3838
'SECRET_KEY',
39-
algorithm='HS256',
39+
algorithms='HS256',
4040
)
4141

4242
expected_issuer = 'https://INSTANCE_ID.pushnotifications.pusher.com'

0 commit comments

Comments
 (0)