Skip to content

Commit 050b0e6

Browse files
committed
Generate JWT valid 5 seconds before generation
1 parent 8dcb4eb commit 050b0e6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

getstream/stream.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ def _create_token(
125125
now = int(time.time())
126126

127127
claims = {
128-
"iat": now,
128+
# generate token valid from 5 seconds ago to avoid unauthorized error due to clock skew
129+
"iat": now - 5,
129130
}
130131

131132
if channel_cids is not None:

0 commit comments

Comments
 (0)