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

Allow custom OAuth URLs #1445

Merged
merged 2 commits into from
Jun 13, 2022
Merged

Allow custom OAuth URLs #1445

merged 2 commits into from
Jun 13, 2022

Conversation

paulomarg
Copy link
Contributor

@paulomarg paulomarg commented Jun 9, 2022

What this PR does

In some cases, the Shopify routes might be mounted under a custom root_url, when the Engine is not mounted at /. Assuming that root_url is expected to match the root URL for the Engine, this PR adds support for customizing both the OAuth login and callback routes so that they can be arbitrarily determined by the app.

The goal here is for this to preserve the current behaviour by default, so I just wanted to make sure that assumption about root_url is actually correct.

Reviewer's guide to testing

Tested via unit tests and by using the gem locally on a CLI-generated app.

Things to focus on

  1. Is this changing any existing behaviour?
  2. Are the test cases covering enough scenarios?
  3. Is it the right thing to strip out root_url from the URLs when setting up the routes? That is where the assumption about root_url comes into play.

Checklist

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

  • Update CHANGELOG.md if the changes would impact users

Copy link
Contributor

@gonzaloriestra gonzaloriestra left a comment

Choose a reason for hiding this comment

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

I haven't tested it, but it LGTM!

@paulomarg paulomarg force-pushed the allow_custom_oauth_routes branch 3 times, most recently from f6a1855 to 893478f Compare June 10, 2022 13:14
Copy link
Contributor

@hannachen hannachen left a comment

Choose a reason for hiding this comment

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

This looks good to me 👍
🎩 with CLI 2.0 and did a quick smoke test

@paulomarg paulomarg merged commit b3b5054 into main Jun 13, 2022
@paulomarg paulomarg deleted the allow_custom_oauth_routes branch June 13, 2022 12:49
@shopify-shipit shopify-shipit bot temporarily deployed to rubygems June 20, 2022 14:03 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants