graphcool-lib icon indicating copy to clipboard operation
graphcool-lib copied to clipboard

Custom token validity time does not work

Open wasd171 opened this issue 8 years ago • 3 comments

Hi!

Calling .generateNodeToken(nodeId, modelName, time) always results in 1 month period, although function signature suggests it would generate a token with appropriate expiration period https://github.com/graphcool/graphcool-lib/blob/9a5432aa86be3d31c90240679ea05634ac189375/src/index.ts#L81

wasd171 avatar Oct 22 '17 19:10 wasd171

Is this fixed? I seem to be able to generate tokens with exp set correctly.

nickluger avatar Dec 19 '17 16:12 nickluger

Any news?

benseitz avatar Feb 14 '18 05:02 benseitz

@benseitz @wasd171 We ended up doing this to get the correct duration: const graphCoolValiditiyDuration = Math.floor(((decoded.exp * 1000) - new Date().getTime()) / 1000);

grimunit avatar Jul 11 '18 16:07 grimunit