opentok/opentok-node

expireTime causes 1004 authentication error.

Closed this issue · 5 comments

Works

token = opentok.generateToken( myToken, {
  role: 'moderator'
});

Broken

token = opentok.generateToken( myToken, {
  role: 'moderator',
  expireTime: (new Date().getTime() / 1000)+(7 * 24 * 60 * 60)
});

the first parameter should be a sessionId, not a token (unless you named your sessionId myToken).

:) sorry ignore that that bit was just a typo, issue is still relevant

reproduced. you are right, sir. thanks for the report.

turns out that the implementation is using the fractional number for expire time (e.g. 1416578335.251) directly because thats what the expireTime value contains. it would be nicer if the module rounded that number for you.

the workaround for now is to just wrap the time in a Math.round()

👍

closing in favor of #76