{"action":"created","issue":{"url":"https://api.github.com/repos/mozilla/delivery-console/issues/220","repository_url":"https://api.github.com/repos/mozilla/delivery-console","labels_url":"https://api.github.com/repos/mozilla/delivery-console/issues/220/labels{/name}","comments_url":"https://api.github.com/repos/mozilla/delivery-console/issues/220/comments","events_url":"https://api.github.com/repos/mozilla/delivery-console/issues/220/events","html_url":"https://github.com/mozilla/delivery-console/pull/220","id":334249307,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk2MjcyMTcz","number":220,"title":"User profile fetch called twice","user":{"login":"peterbe","id":26739,"node_id":"MDQ6VXNlcjI2NzM5","avatar_url":"https://avatars2.githubusercontent.com/u/26739?v=4","gravatar_id":"","url":"https://api.github.com/users/peterbe","html_url":"https://github.com/peterbe","followers_url":"https://api.github.com/users/peterbe/followers","following_url":"https://api.github.com/users/peterbe/following{/other_user}","gists_url":"https://api.github.com/users/peterbe/gists{/gist_id}","starred_url":"https://api.github.com/users/peterbe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterbe/subscriptions","organizations_url":"https://api.github.com/users/peterbe/orgs","repos_url":"https://api.github.com/users/peterbe/repos","events_url":"https://api.github.com/users/peterbe/events{/privacy}","received_events_url":"https://api.github.com/users/peterbe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-06-20T21:05:57Z","updated_at":"2018-06-20T21:12:07Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/mozilla/delivery-console/pulls/220","html_url":"https://github.com/mozilla/delivery-console/pull/220","diff_url":"https://github.com/mozilla/delivery-console/pull/220.diff","patch_url":"https://github.com/mozilla/delivery-console/pull/220.patch"},"body":"fixes #219\r\n\r\nFirst I just wanted to remove the extra call to `fetchUserProfile` in `componentWillReceiveProps` but then I realized that we already fetch the user profile with our `webAuth.authorize({...})` call because we use `responseType: 'token id_token'`. \r\n\r\nSecondly, if the user profile is already stored in localStorage we can set in Redux BEFORE the `<AuthButton/>` component mounts meaning, if the user is logged in and nothing major is happening, we can go straight to displaying the `this.props.userProfile` there. No flashing of the \"Log in\" button. "},"comment":{"url":"https://api.github.com/repos/mozilla/delivery-console/issues/comments/398898522","html_url":"https://github.com/mozilla/delivery-console/pull/220#issuecomment-398898522","issue_url":"https://api.github.com/repos/mozilla/delivery-console/issues/220","id":398898522,"node_id":"MDEyOklzc3VlQ29tbWVudDM5ODg5ODUyMg==","user":{"login":"peterbe","id":26739,"node_id":"MDQ6VXNlcjI2NzM5","avatar_url":"https://avatars2.githubusercontent.com/u/26739?v=4","gravatar_id":"","url":"https://api.github.com/users/peterbe","html_url":"https://github.com/peterbe","followers_url":"https://api.github.com/users/peterbe/followers","following_url":"https://api.github.com/users/peterbe/following{/other_user}","gists_url":"https://api.github.com/users/peterbe/gists{/gist_id}","starred_url":"https://api.github.com/users/peterbe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterbe/subscriptions","organizations_url":"https://api.github.com/users/peterbe/orgs","repos_url":"https://api.github.com/users/peterbe/repos","events_url":"https://api.github.com/users/peterbe/events{/privacy}","received_events_url":"https://api.github.com/users/peterbe/received_events","type":"User","site_admin":false},"created_at":"2018-06-20T21:12:07Z","updated_at":"2018-06-20T21:12:07Z","author_association":"CONTRIBUTOR","body":"One thing to note; if I...\r\n\r\n1. Log in.\r\n2. Close my browser.\r\n3. Start my browser 5 minutes later. \r\n\r\nIt will say \"Logged in as Peter\" for about 2 hours without ever checking that I'm still *not* blocked in Auth0. \r\n\r\nHowever, I https://github.com/mozilla/delivery-console/issues/155 we're going to use `webAuth.checkSession` and call that upon initial mount (and then roughly every 2 hours) so that will take care of not falsely saying you're logged in for 2 hours. \r\n\r\nNote! This is *not* security related since if you try to do anything with the accessToken, the likes of Normandy will check the accessToken on every request so it's not like you can do anything with your accessToken for those two hours if you're blocked in Auth0. "}}
{"actor":{"display_login":"peterbe"}}