{"action":"closed","issue":{"url":"https://api.github.com/repos/IdentityModel/oidc-client/issues/19","repository_url":"https://api.github.com/repos/IdentityModel/oidc-client","labels_url":"https://api.github.com/repos/IdentityModel/oidc-client/issues/19/labels{/name}","comments_url":"https://api.github.com/repos/IdentityModel/oidc-client/issues/19/comments","events_url":"https://api.github.com/repos/IdentityModel/oidc-client/issues/19/events","html_url":"https://github.com/IdentityModel/oidc-client/issues/19","id":134965574,"number":19,"title":"Shouldn't Token expired check be based on UTC time?","user":{"login":"merijndejonge","id":1928998,"avatar_url":"https://avatars.githubusercontent.com/u/1928998?v=3","gravatar_id":"","url":"https://api.github.com/users/merijndejonge","html_url":"https://github.com/merijndejonge","followers_url":"https://api.github.com/users/merijndejonge/followers","following_url":"https://api.github.com/users/merijndejonge/following{/other_user}","gists_url":"https://api.github.com/users/merijndejonge/gists{/gist_id}","starred_url":"https://api.github.com/users/merijndejonge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/merijndejonge/subscriptions","organizations_url":"https://api.github.com/users/merijndejonge/orgs","repos_url":"https://api.github.com/users/merijndejonge/repos","events_url":"https://api.github.com/users/merijndejonge/events{/privacy}","received_events_url":"https://api.github.com/users/merijndejonge/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/IdentityModel/oidc-client/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-02-19T20:25:34Z","updated_at":"2016-02-22T18:01:45Z","closed_at":"2016-02-22T18:01:45Z","body":"Hi,\r\nIn method validateIdTokenAsync the following code checks if a token is expired or not:\r\n```javascript\r\n    var now = parseInt(Date.now() / 1000);\r\n    if (id_token_contents.exp < now ) {\r\n       return error(\"Token expired\");\r\n    }\r\n```\r\nShouldn't take this check time zones into account. In typical cases, the id_token_contents.exp value is provided by the server, right, which may run in another timezone than the client that executes `Date.now()`. My guess is that `now` should be corrected with the timezone offset as returned by `new Date().getTimezoneOffset()`.\r\n\r\nAm I correct in this, or did I overlook something?\r\n\r\nKind regards,\r\nMerijn"}}