payload: {"action":"created","issue":{"url":"https://api.github.com/repos/eJourn-al/eJournal/issues/585","repository_url":"https://api.github.com/repos/eJourn-al/eJournal","labels_url":"https://api.github.com/repos/eJourn-al/eJournal/issues/585/labels{/name}","comments_url":"https://api.github.com/repos/eJourn-al/eJournal/issues/585/comments","events_url":"https://api.github.com/repos/eJourn-al/eJournal/issues/585/events","html_url":"https://github.com/eJourn-al/eJournal/issues/585","id":410842436,"node_id":"MDU6SXNzdWU0MTA4NDI0MzY=","number":585,"title":"Excessive 'Token expired' toasts","user":{"login":"engelhamer","id":39912581,"node_id":"MDQ6VXNlcjM5OTEyNTgx","avatar_url":"https://avatars3.githubusercontent.com/u/39912581?v=4","gravatar_id":"","url":"https://api.github.com/users/engelhamer","html_url":"https://github.com/engelhamer","followers_url":"https://api.github.com/users/engelhamer/followers","following_url":"https://api.github.com/users/engelhamer/following{/other_user}","gists_url":"https://api.github.com/users/engelhamer/gists{/gist_id}","starred_url":"https://api.github.com/users/engelhamer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/engelhamer/subscriptions","organizations_url":"https://api.github.com/users/engelhamer/orgs","repos_url":"https://api.github.com/users/engelhamer/repos","events_url":"https://api.github.com/users/engelhamer/events{/privacy}","received_events_url":"https://api.github.com/users/engelhamer/received_events","type":"User","site_admin":false},"labels":[{"id":1211563549,"node_id":"MDU6TGFiZWwxMjExNTYzNTQ5","url":"https://api.github.com/repos/eJourn-al/eJournal/labels/Status:%20Pending","name":"Status: Pending","color":"FAFCBB","default":false},{"id":1211576372,"node_id":"MDU6TGFiZWwxMjExNTc2Mzcy","url":"https://api.github.com/repos/eJourn-al/eJournal/labels/Type:%20Bug","name":"Type: Bug","color":"ea0000","default":false}],"state":"open","locked":false,"assignee":{"login":"mjvkeulen","id":39912610,"node_id":"MDQ6VXNlcjM5OTEyNjEw","avatar_url":"https://avatars2.githubusercontent.com/u/39912610?v=4","gravatar_id":"","url":"https://api.github.com/users/mjvkeulen","html_url":"https://github.com/mjvkeulen","followers_url":"https://api.github.com/users/mjvkeulen/followers","following_url":"https://api.github.com/users/mjvkeulen/following{/other_user}","gists_url":"https://api.github.com/users/mjvkeulen/gists{/gist_id}","starred_url":"https://api.github.com/users/mjvkeulen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjvkeulen/subscriptions","organizations_url":"https://api.github.com/users/mjvkeulen/orgs","repos_url":"https://api.github.com/users/mjvkeulen/repos","events_url":"https://api.github.com/users/mjvkeulen/events{/privacy}","received_events_url":"https://api.github.com/users/mjvkeulen/received_events","type":"User","site_admin":false},"assignees":[{"login":"mjvkeulen","id":39912610,"node_id":"MDQ6VXNlcjM5OTEyNjEw","avatar_url":"https://avatars2.githubusercontent.com/u/39912610?v=4","gravatar_id":"","url":"https://api.github.com/users/mjvkeulen","html_url":"https://github.com/mjvkeulen","followers_url":"https://api.github.com/users/mjvkeulen/followers","following_url":"https://api.github.com/users/mjvkeulen/following{/other_user}","gists_url":"https://api.github.com/users/mjvkeulen/gists{/gist_id}","starred_url":"https://api.github.com/users/mjvkeulen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjvkeulen/subscriptions","organizations_url":"https://api.github.com/users/mjvkeulen/orgs","repos_url":"https://api.github.com/users/mjvkeulen/repos","events_url":"https://api.github.com/users/mjvkeulen/events{/privacy}","received_events_url":"https://api.github.com/users/mjvkeulen/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2019-02-15T16:19:48Z","updated_at":"2019-03-08T12:33:08Z","closed_at":null,"author_association":"MEMBER","body":"**Describe the bug**\r\nIf a user was previously logged in but their token has expired, they will be redirected to a login screen when they try to visit a page. Upon arrival, two (sometimes more) toasts stating that their token has expired (or might be invalid) pop up.\r\n\r\n**To Reproduce**\r\nSteps to reproduce the behavior:\r\n1. Log in\r\n2. Wait for the token to expire\r\n3. Visit a page\r\n4. Observe an abundance of toasts\r\n\r\n**Expected behavior**\r\nOnly one toast."},"comment":{"url":"https://api.github.com/repos/eJourn-al/eJournal/issues/comments/470913215","html_url":"https://github.com/eJourn-al/eJournal/issues/585#issuecomment-470913215","issue_url":"https://api.github.com/repos/eJourn-al/eJournal/issues/585","id":470913215,"node_id":"MDEyOklzc3VlQ29tbWVudDQ3MDkxMzIxNQ==","user":{"login":"mjvkeulen","id":39912610,"node_id":"MDQ6VXNlcjM5OTEyNjEw","avatar_url":"https://avatars2.githubusercontent.com/u/39912610?v=4","gravatar_id":"","url":"https://api.github.com/users/mjvkeulen","html_url":"https://github.com/mjvkeulen","followers_url":"https://api.github.com/users/mjvkeulen/followers","following_url":"https://api.github.com/users/mjvkeulen/following{/other_user}","gists_url":"https://api.github.com/users/mjvkeulen/gists{/gist_id}","starred_url":"https://api.github.com/users/mjvkeulen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjvkeulen/subscriptions","organizations_url":"https://api.github.com/users/mjvkeulen/orgs","repos_url":"https://api.github.com/users/mjvkeulen/repos","events_url":"https://api.github.com/users/mjvkeulen/events{/privacy}","received_events_url":"https://api.github.com/users/mjvkeulen/received_events","type":"User","site_admin":false},"created_at":"2019-03-08T12:33:08Z","updated_at":"2019-03-08T12:33:08Z","author_association":"COLLABORATOR","body":"This occurs because loading a page triggers multiple api requests, each of which will first try to refresh the token in localstorage. As the token is indeed invalid, all refresh attempts will fail, each in turn toasting their respective error message. Which for this scenario is the same message of the token being invalid. This mechanism is flawed in its design, as when a single request fails due to the token being invalid all other authenticated request are guaranteed to fail anyway.\r\n\r\nIdeally, upon failing a request due to an invalid token, all other invalid requests (by token) should be queued until the first request has successfully refreshed the token and then be tried again."}}
other: {"actor":{"display_login":"mjvkeulen"}}