Add a default value for the setup option. #25
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@kevinhughes27 & @EiNSTeiN- for review
Depends on and include pull #24, see the last commit for this pull request's changesProblem
Right now we have boilerplate code generated for the omniauth setup option in shopify_app, which basically prevents us from making any improvements to it without updating all those apps. For instance, we have a fix_https method which seems to only exist for the purpose of working around old setup lambdas that don't prefix the url with
http://
instead ofhttps://
(e.g. commit aa533f0 fixed the setup lambda in the README).Also, we should have a default just to make the gem simpler to use.
Solution
Use
option :setup,
... to set a default proc to use for the setup.Possible Enhancements
We might want to consider allowing merchants to enter their shop name without the
.myshopify.com
suffix and having the setup handle that automatically for the authorization endpoint that just redirects to Shopify. For now I have just added a test to show how that can be done.