Move site url regex to constant #7

Closed
wants to merge 1 commit into
from

3 participants

@bradleypriest

Moved the regex to a readable constant so we can check validity manually if need be

@EiNSTeiN-

Why is this necessary? Validating the site incorrectly can lead to complete auth bypass as well as loosing your app's api secret, which was the reason for adding this regex in the first place.

@bradleypriest

I don't want to override, but I want to check the URL myself before redirecting and fetching a valid URL first otherwise.

@cefigueiredo

I agree with @EiNSTeiN-
What is the point on check yourself the validity.
The method that checks validity looks pretty clear to me... or your are using the gem to check something else than a shopify address?

@bradleypriest

I'm not trying to override the constant, I want to use the constant to check validity before it even hits omniauth, if it's invalid I do my best to work out the correct URL before passing it to omniauth.

Currently, I have just copied the regexp across, but that's not DRY and could get out of sync

@bradleypriest

I guess I'll just keep with the copied version then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment