@stream-io/node-sdk 0.2.3 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stream-io/node-sdk",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.es.js",
@@ -138,8 +138,8 @@ export class StreamClient {
138
138
  */
139
139
  createToken(
140
140
  userID: string,
141
- exp = Math.round(new Date().getTime() / 1000) + 60 * 60,
142
- iat = Math.round(Date.now() / 1000),
141
+ exp = Math.round(Date.now() / 1000) + 60 * 60,
142
+ iat = Math.floor((Date.now() - 1000) / 1000),
143
143
  call_cids?: string[],
144
144
  ) {
145
145
  const payload: UserTokenPayload = {
@@ -169,8 +169,8 @@ export class StreamClient {
169
169
  createCallToken(
170
170
  userIdOrObject: string | { user_id: string; role?: string },
171
171
  call_cids: string[],
172
- exp = Math.round(new Date().getTime() / 1000) + 60 * 60,
173
- iat = Math.round(Date.now() / 1000),
172
+ exp = Math.round(Date.now() / 1000) + 60 * 60,
173
+ iat = Math.floor((Date.now() - 1000) / 1000),
174
174
  ) {
175
175
  const payload: CallTokenPayload = {
176
176
  exp,