Skip to content
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

Redirect to shopify managed install path during login #1818

Merged
merged 2 commits into from
Mar 27, 2024
Merged

Conversation

zzooeeyy
Copy link
Contributor

@zzooeeyy zzooeeyy commented Mar 25, 2024

For issue:

Depends on issue: (not directly, but the redirects won't work properly unless we have token exchange)

📹 VIDEO DEMO

What this PR does

Redirect to Shopify managed install path during login instead of starting auth code OAuth flow.

Checklist

Before submitting the PR, please consider if any of the following are needed:

  • [ will update when token exchange feature is complete ] Update CHANGELOG.md if the changes would impact users
  • [ will update when token exchange feature is complete ] Update README.md, if appropriate.
  • [ will update when token exchange feature is complete ] Update any relevant pages in /docs, if necessary

@zzooeeyy zzooeeyy marked this pull request as ready for review March 25, 2024 21:01
@zzooeeyy zzooeeyy requested a review from a team as a code owner March 25, 2024 21:01
Copy link
Contributor

@paulomarg paulomarg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just the one question about the tests :)

"http://my-shop.myshopify.com",
"https://admin.shopify.com/store/my-shop",
].each do |good_url|
test "#create redirects to Shopify managed install path instead if use_new_embedded_auth_strategy is enabled - #{good_url}" do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we / should we have a test for bad URLs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are already tests for bad URLs, and the logic to redirect to invalid shop error happens regardless of "use new embedded auth strategy".. So I think the existing tests should be sufficient? If not it'll be pretty easy to add the extra cases like:

[
  true,
  false,
].each do |use_new_embedded_auth_strategy|
  test "existing test cases for invalid urls"
# 
#
end

Let me know if you want me to add it!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah if it's simple to duplicate it might help protect us against regressions just in case we ever change that code.

"https://admin.shopify.com/store/my-shop",
].each do |good_url|
test "#create redirects to Shopify managed install path instead if use_new_embedded_auth_strategy is enabled - #{good_url}" do
ShopifyApp.configuration.wip_new_embedded_auth_strategy = true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be a bit too late for this question, why do we have wip in the name? Will it be changed to something more official in the future?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yess it's wip right now since we're still building and merging feature incrementally. Once it's ready to be "shipped" officially, we'll rename this to be the same as Remix's future flag- unstable_new_embedded_auth_strategy

@zzooeeyy zzooeeyy merged commit 5c51437 into main Mar 27, 2024
7 checks passed
@zzooeeyy zzooeeyy deleted the login-to-install branch March 27, 2024 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants