Skip to content

Commit 0ad5fc3

Browse files
pterkferhatelmas
andauthored
Allow custom payload in client.create_jwt_token (#121)
Co-authored-by: ferhat elmas <[email protected]>
1 parent 10a2614 commit 0ad5fc3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stream/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,12 @@ def create_user_token(self, user_id, **extra_data):
178178
payload[k] = v
179179
return jwt.encode(payload, self.api_secret, algorithm="HS256").decode("utf-8")
180180

181-
def create_jwt_token(self, resource, action, feed_id=None, user_id=None):
181+
def create_jwt_token(self, resource, action, feed_id=None, user_id=None, **params):
182182
"""
183183
Setup the payload for the given resource, action, feed or user
184184
and encode it using jwt
185185
"""
186-
payload = {"action": action, "resource": resource}
186+
payload = {**params, "action": action, "resource": resource}
187187
if feed_id is not None:
188188
payload["feed_id"] = feed_id
189189
if user_id is not None:

0 commit comments

Comments
 (0)