{"action":"created","issue":{"url":"https://api.github.com/repos/manfredsteyer/angular-oauth2-oidc/issues/285","repository_url":"https://api.github.com/repos/manfredsteyer/angular-oauth2-oidc","labels_url":"https://api.github.com/repos/manfredsteyer/angular-oauth2-oidc/issues/285/labels{/name}","comments_url":"https://api.github.com/repos/manfredsteyer/angular-oauth2-oidc/issues/285/comments","events_url":"https://api.github.com/repos/manfredsteyer/angular-oauth2-oidc/issues/285/events","html_url":"https://github.com/manfredsteyer/angular-oauth2-oidc/issues/285","id":313272307,"number":285,"title":"Support automatically refreshing tokens","user":{"login":"imgx64","id":318668,"avatar_url":"https://avatars0.githubusercontent.com/u/318668?v=4","gravatar_id":"","url":"https://api.github.com/users/imgx64","html_url":"https://github.com/imgx64","followers_url":"https://api.github.com/users/imgx64/followers","following_url":"https://api.github.com/users/imgx64/following{/other_user}","gists_url":"https://api.github.com/users/imgx64/gists{/gist_id}","starred_url":"https://api.github.com/users/imgx64/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imgx64/subscriptions","organizations_url":"https://api.github.com/users/imgx64/orgs","repos_url":"https://api.github.com/users/imgx64/repos","events_url":"https://api.github.com/users/imgx64/events{/privacy}","received_events_url":"https://api.github.com/users/imgx64/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-04-11T10:52:55Z","updated_at":"2018-04-19T16:00:34Z","closed_at":null,"author_association":"NONE","body":"Currently, calling `getAccessToken()` may return an expired token, and so you have to do the following every time:\r\n\r\n1. call `getAccessTokenExpiration()` and compare it with `Date.now()`\r\n2. if it's not expired, call `getAccessToken()`\r\n2. else if it's expired, then call `refreshToken()`\r\n3. after `refreshToken()` finishes, call `getAccessToken()`\r\n\r\nI think there should be a method that does all this, and returns a `Promise<string>`."},"comment":{"url":"https://api.github.com/repos/manfredsteyer/angular-oauth2-oidc/issues/comments/382789931","html_url":"https://github.com/manfredsteyer/angular-oauth2-oidc/issues/285#issuecomment-382789931","issue_url":"https://api.github.com/repos/manfredsteyer/angular-oauth2-oidc/issues/285","id":382789931,"user":{"login":"asmolenic","id":10207196,"avatar_url":"https://avatars3.githubusercontent.com/u/10207196?v=4","gravatar_id":"","url":"https://api.github.com/users/asmolenic","html_url":"https://github.com/asmolenic","followers_url":"https://api.github.com/users/asmolenic/followers","following_url":"https://api.github.com/users/asmolenic/following{/other_user}","gists_url":"https://api.github.com/users/asmolenic/gists{/gist_id}","starred_url":"https://api.github.com/users/asmolenic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asmolenic/subscriptions","organizations_url":"https://api.github.com/users/asmolenic/orgs","repos_url":"https://api.github.com/users/asmolenic/repos","events_url":"https://api.github.com/users/asmolenic/events{/privacy}","received_events_url":"https://api.github.com/users/asmolenic/received_events","type":"User","site_admin":false},"created_at":"2018-04-19T16:00:34Z","updated_at":"2018-04-19T16:00:34Z","author_association":"NONE","body":"The automatic token refresh feature seems functional to me. I am using it with implicit flow."}}
{"actor":{"display_login":"asmolenic"}}