-
Notifications
You must be signed in to change notification settings - Fork 678
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move ownership for session persistence from library to this gem #1563
Conversation
427faab
to
bd65c2d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Just to be sure I didn't miss out somewhere, I tested this by generating a new app. Then I installed it to a store and saw products. This should be enough right?
Thanks for the 🎩 , @klenotiw ! Before we release the next version, I'll do a test with the CLI to make sure everything looks good as well! |
…ify#1563) * session stored in rails instead of library * move responsiblity for session persistence * move load_current_session to login_protection * FIXME notes * Move session concerns back to session utils * Add `embedded` param to `splash_page` (Shopify#1549) * use online tokens appropriately if there is a user session storage available * move load_current_session to login_protection * Move session concerns back to session utils * refactor login protection and tests with sesison ownership change * rubocop'd * no more session_storage in generated example * add x86_65-linux platform for CI * no more local pointer to api lib * more gemlock Co-authored-by: rdillensnyder <101280580+rdillensnyder@users.noreply.github.com> Co-authored-by: Teddy Hwang <teddy.hwang@shopify.com>
What this PR does
Exploring the idea of moving session persistence calls to this gem instead of passing
ShopifyApp::SessionRepository
to the API library and having the API library be responsible for persisting the session. Having the API library invoke Rails' persistence is backward from a responsibility perspective.The goal with this proposal is to use the API library that already returns a session payload to the
shopify_app
and use that payload to persist and load session data using theShopifyApp::SessionRepository
exclusively and remove any concept of session persistence from the API library.TODO
ShopifyAPI::Auth::SessionStorage
fromSessionRepository
now?Reviewer's guide to testing
This is a risky change in that all API calls and authentication code has been modified. We'll want to perform a full regression of the features of the gem and ensure we can make rest / graphql calls with the new session interface.
Checklist
Before submitting the PR, please consider if any of the following are needed:
CHANGELOG.md
if the changes would impact usersREADME.md
, if appropriate./docs
, if necessary