{"action":"created","issue":{"url":"https://api.github.com/repos/kevinhughes27/shopify-sinatra-app/issues/4","labels_url":"https://api.github.com/repos/kevinhughes27/shopify-sinatra-app/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/kevinhughes27/shopify-sinatra-app/issues/4/comments","events_url":"https://api.github.com/repos/kevinhughes27/shopify-sinatra-app/issues/4/events","html_url":"https://github.com/kevinhughes27/shopify-sinatra-app/issues/4","id":53688094,"number":4,"title":"Always redo oauth for missing session","user":{"login":"kevinhughes27","id":1965489,"avatar_url":"https://avatars.githubusercontent.com/u/1965489?v=3","gravatar_id":"","url":"https://api.github.com/users/kevinhughes27","html_url":"https://github.com/kevinhughes27","followers_url":"https://api.github.com/users/kevinhughes27/followers","following_url":"https://api.github.com/users/kevinhughes27/following{/other_user}","gists_url":"https://api.github.com/users/kevinhughes27/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinhughes27/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinhughes27/subscriptions","organizations_url":"https://api.github.com/users/kevinhughes27/orgs","repos_url":"https://api.github.com/users/kevinhughes27/repos","events_url":"https://api.github.com/users/kevinhughes27/events{/privacy}","received_events_url":"https://api.github.com/users/kevinhughes27/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-01-07T22:02:51Z","updated_at":"2015-11-29T19:32:02Z","closed_at":"2015-11-29T19:32:02Z","body":"While working on another Shopify App (in rails) I came across a different technique for handling the shop oauth access tokens:\r\n\r\nCurrently in this framework I check if I already have the shop in my database and if I do then I load the token and use it (https://github.com/pickle27/shopify-sinatra-app/blob/master/lib/sinatra/shopify-sinatra-app.rb#L89).\r\n\r\nThis new approach always re-does the oauth handshake and then updates the stored token (unless they already have a session). \r\n\r\nI think this new way might be safer as I have always worried that there could be strange states with my current approach where the app token doesn't match somehow. This other approach also removes the dependency on the uninstall webhook and corresponding route behaving properly for the app uninstall, re-install to work properly. It would also allow you to not remove user data on uninstall in case the uninstall was mistaken (when they reinstall you will save a new token and the rest of their data is still there).\r\n\r\nI should be able to make this change in a non-breaking fashion and updating the gem will get the new safer behaviour"},"comment":{"url":"https://api.github.com/repos/kevinhughes27/shopify-sinatra-app/issues/comments/160455299","html_url":"https://github.com/kevinhughes27/shopify-sinatra-app/issues/4#issuecomment-160455299","issue_url":"https://api.github.com/repos/kevinhughes27/shopify-sinatra-app/issues/4","id":160455299,"user":{"login":"kevinhughes27","id":1965489,"avatar_url":"https://avatars.githubusercontent.com/u/1965489?v=3","gravatar_id":"","url":"https://api.github.com/users/kevinhughes27","html_url":"https://github.com/kevinhughes27","followers_url":"https://api.github.com/users/kevinhughes27/followers","following_url":"https://api.github.com/users/kevinhughes27/following{/other_user}","gists_url":"https://api.github.com/users/kevinhughes27/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinhughes27/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinhughes27/subscriptions","organizations_url":"https://api.github.com/users/kevinhughes27/orgs","repos_url":"https://api.github.com/users/kevinhughes27/repos","events_url":"https://api.github.com/users/kevinhughes27/events{/privacy}","received_events_url":"https://api.github.com/users/kevinhughes27/received_events","type":"User","site_admin":false},"created_at":"2015-11-29T19:32:02Z","updated_at":"2015-11-29T19:32:02Z","body":"closed by #12"}}