{"action":"created","issue":{"url":"https://api.github.com/repos/MakingSense/mern-seed/issues/33","repository_url":"https://api.github.com/repos/MakingSense/mern-seed","labels_url":"https://api.github.com/repos/MakingSense/mern-seed/issues/33/labels{/name}","comments_url":"https://api.github.com/repos/MakingSense/mern-seed/issues/33/comments","events_url":"https://api.github.com/repos/MakingSense/mern-seed/issues/33/events","html_url":"https://github.com/MakingSense/mern-seed/pull/33","id":266646309,"number":33,"title":"WIP Login jwt","user":{"login":"dtoranzoms","id":32906444,"avatar_url":"https://avatars1.githubusercontent.com/u/32906444?v=4","gravatar_id":"","url":"https://api.github.com/users/dtoranzoms","html_url":"https://github.com/dtoranzoms","followers_url":"https://api.github.com/users/dtoranzoms/followers","following_url":"https://api.github.com/users/dtoranzoms/following{/other_user}","gists_url":"https://api.github.com/users/dtoranzoms/gists{/gist_id}","starred_url":"https://api.github.com/users/dtoranzoms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dtoranzoms/subscriptions","organizations_url":"https://api.github.com/users/dtoranzoms/orgs","repos_url":"https://api.github.com/users/dtoranzoms/repos","events_url":"https://api.github.com/users/dtoranzoms/events{/privacy}","received_events_url":"https://api.github.com/users/dtoranzoms/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-10-18T21:22:06Z","updated_at":"2017-10-19T13:32:30Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/MakingSense/mern-seed/pulls/33","html_url":"https://github.com/MakingSense/mern-seed/pull/33","diff_url":"https://github.com/MakingSense/mern-seed/pull/33.diff","patch_url":"https://github.com/MakingSense/mern-seed/pull/33.patch"},"body":"This is a WIP.\r\n\r\nIt works but tests fail because I am using sessionStorage and I need to mock it somehow.\r\n\r\nOn the other hand, I am not really convinced about the sessionStorage but I googled a bit and it seems the way to go. I would like to have some kind of interceptor that dynamically completes the Authorization header in the requests that need it.\r\n\r\nLet me know your thoughts, I will appreciate it.\r\n\r\nP.S.:\r\n\r\nI added a checkbox to the login (signup checkbox) so if it is selected the user is created in the data base, because the first time you run the app you have no user. In that case a new input should be added to the form asking the user's email."},"comment":{"url":"https://api.github.com/repos/MakingSense/mern-seed/issues/comments/337908756","html_url":"https://github.com/MakingSense/mern-seed/pull/33#issuecomment-337908756","issue_url":"https://api.github.com/repos/MakingSense/mern-seed/issues/33","id":337908756,"user":{"login":"pablomigliasso","id":26231253,"avatar_url":"https://avatars0.githubusercontent.com/u/26231253?v=4","gravatar_id":"","url":"https://api.github.com/users/pablomigliasso","html_url":"https://github.com/pablomigliasso","followers_url":"https://api.github.com/users/pablomigliasso/followers","following_url":"https://api.github.com/users/pablomigliasso/following{/other_user}","gists_url":"https://api.github.com/users/pablomigliasso/gists{/gist_id}","starred_url":"https://api.github.com/users/pablomigliasso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pablomigliasso/subscriptions","organizations_url":"https://api.github.com/users/pablomigliasso/orgs","repos_url":"https://api.github.com/users/pablomigliasso/repos","events_url":"https://api.github.com/users/pablomigliasso/events{/privacy}","received_events_url":"https://api.github.com/users/pablomigliasso/received_events","type":"User","site_admin":false},"created_at":"2017-10-19T13:32:30Z","updated_at":"2017-10-19T13:32:30Z","author_association":"COLLABORATOR","body":"@dtoranzoms regarding your question about mocking sessionStorage, in my previous project i used jest and it looks like this:\r\n\r\ntests/testSetup.js\r\n\r\n```\r\nconst localStorageMock = {\r\n  getItem: () => {},\r\n  setItem: () => {},\r\n  removeItem: () => {},\r\n  clear: () => {},\r\n};\r\n\r\nglobal.localStorage = localStorageMock;\r\n```\r\nAs you can see i am using `localStorage` instead of `sessionStorage`.  So, why did you decide to use `sessionStorage` rather than `localStorage`? Do you know the difference between them?"}}
{"actor":{"display_login":"pablomigliasso"}}