dwyl/learn-json-web-tokens

Issue with default expiry time

开放

#43 创建于 2015年8月3日

 (6 条评论) (0 个反应) (0 位负责人)JavaScript (267 个派生)batch import
bughelp wanted

仓库指标

星标
 (4,175 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

The intention is to expire in 7 days, but the code doesn't provide a number thats 7 days ahead of now...far from it! https://github.com/dwyl/learn-json-web-tokens/blob/master/example/lib/helpers.js#L39

$ node
> var x = Math.floor(new Date().getTime()/1000) + 7*24*60*60
undefined
> new Date(x)
Sat Jan 17 1970 15:46:41 GMT+0000 (BST)
> 

I used this instead:

Date.now() + (1000 * 60 * 60 * 24 * 7)

贡献者指南