Shopify/omniauth-shopify-oauth2

Authentication failure! invalid_site encountered with iOS App

atmcmillan opened this issue · 1 comments

When accessing an app via the iOS Shopify app, the Authentication failure! invalid_site encountered error is returned. When accessing it a second time, the app loads without issue. This happens on a fresh app, using version 8.2.5 of the shopify_app gem, running on heroku and is repeatable.

I have added some logging to the code and in valid_site? the options[:client_options][:site] is blank the first time the app is accessed, explaining the fact that the app doesn't load.

def valid_site?
puts "SITE NAME: #{options[:client_options][:site]}"
!!(/\A(https|http)\:\/\/[a-zA-Z0-9][a-zA-Z0-9\-]*\.#{Regexp.quote(options[:myshopify_domain])}[\/]?\z/ =~ options[:client_options][:site])
end

Output from my logs: omniauth-shopify-oauth2.log

Any clues as to why this is happening?

Hi @atmcmillan thanks for the report, and sorry for the delay in responding to it. I've cleaned up some confusion around shop name validation. Try the latest version of this gem and feel free to reopen if you have any issues.