{"action":"created","issue":{"url":"https://api.github.com/repos/lelylan/simple-oauth2/issues/115","repository_url":"https://api.github.com/repos/lelylan/simple-oauth2","labels_url":"https://api.github.com/repos/lelylan/simple-oauth2/issues/115/labels{/name}","comments_url":"https://api.github.com/repos/lelylan/simple-oauth2/issues/115/comments","events_url":"https://api.github.com/repos/lelylan/simple-oauth2/issues/115/events","html_url":"https://github.com/lelylan/simple-oauth2/issues/115","id":193765518,"number":115,"title":"expires_at is broken","user":{"login":"arekkas","id":3372410,"avatar_url":"https://avatars.githubusercontent.com/u/3372410?v=3","gravatar_id":"","url":"https://api.github.com/users/arekkas","html_url":"https://github.com/arekkas","followers_url":"https://api.github.com/users/arekkas/followers","following_url":"https://api.github.com/users/arekkas/following{/other_user}","gists_url":"https://api.github.com/users/arekkas/gists{/gist_id}","starred_url":"https://api.github.com/users/arekkas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arekkas/subscriptions","organizations_url":"https://api.github.com/users/arekkas/orgs","repos_url":"https://api.github.com/users/arekkas/repos","events_url":"https://api.github.com/users/arekkas/events{/privacy}","received_events_url":"https://api.github.com/users/arekkas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-12-06T12:56:20Z","updated_at":"2016-12-07T03:25:50Z","closed_at":null,"body":"Not sure what's happening, but it looks like `https://github.com/lelylan/simple-oauth2/blob/master/lib/client/access-token.js#L25` is broken, because:\r\n\r\n```\r\nfunction addSeconds (dirtyDate, amount) {\r\n  var date = parse(dirtyDate)\r\n\r\n  console.log('dirtyDate ', dirtyDate)\r\n  console.log('parsedDate', date)\r\n  console.log('amount', amount)\r\n\r\n  date.setSeconds(date.getSeconds() + amount)\r\n\r\n  console.log('after transformation', dirtyDate, date, amount)\r\n\r\n  return date\r\n}\r\n```\r\n\r\nis broken, result:\r\n\r\n```\r\ndirtyDate 2016-12-06T12:49:46.664Z\r\nparsedDate 2016-12-06T12:49:46.664Z\r\namount 60\r\nafter transformation 2016-12-06T14:06:40.664Z\r\n```\r\n\r\nWhere the expected result would be `2016-12-06T12:50:46.664Z`. This in turn causes `token.expired()` to trigger false positives, which in turn causes refresh tokens not to be generated. I know this is a problem of the dependency, but maybe a dependency update would already help?"},"comment":{"url":"https://api.github.com/repos/lelylan/simple-oauth2/issues/comments/265345405","html_url":"https://github.com/lelylan/simple-oauth2/issues/115#issuecomment-265345405","issue_url":"https://api.github.com/repos/lelylan/simple-oauth2/issues/115","id":265345405,"user":{"login":"jonathansamines","id":1268268,"avatar_url":"https://avatars.githubusercontent.com/u/1268268?v=3","gravatar_id":"","url":"https://api.github.com/users/jonathansamines","html_url":"https://github.com/jonathansamines","followers_url":"https://api.github.com/users/jonathansamines/followers","following_url":"https://api.github.com/users/jonathansamines/following{/other_user}","gists_url":"https://api.github.com/users/jonathansamines/gists{/gist_id}","starred_url":"https://api.github.com/users/jonathansamines/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonathansamines/subscriptions","organizations_url":"https://api.github.com/users/jonathansamines/orgs","repos_url":"https://api.github.com/users/jonathansamines/repos","events_url":"https://api.github.com/users/jonathansamines/events{/privacy}","received_events_url":"https://api.github.com/users/jonathansamines/received_events","type":"User","site_admin":false},"created_at":"2016-12-07T03:25:50Z","updated_at":"2016-12-07T03:25:50Z","body":"That is likely because your token response is returning the `expires_in` property as a string. See https://github.com/lelylan/simple-oauth2/blob/master/lib/client/access-token.js#L25\r\n"}}
{"actor":{"display_login":"jonathansamines"}}