I switched from authentication to oauth2 in the Shopify app. Now, when I visit the application on the store administration page (My Applications → Application), it always redirects me to the login page, and does not register the store directly in the application (as before).
Below is the code in the finalize method.
if response = request.env['omniauth.auth'] sess = ShopifyAPI::Session.new(params['shop'], response['credentials']['token']) ShopifyAPI::Base.activate_session(sess) session[:shopify] = sess flash[:notice] = "Logged in" redirect_to return_address session[:return_to] = nil else flash[:error] = "Could not log in to Shopify store." redirect_to :action => 'index' end
When a user visits the application from the store administration page, he does not have request.env ['omniauth.auth'] in the request and is redirected to the login page, since this was not the case when we had an authentication mechanism.
The application URL is www.orderlyprint-staging.herokuapp.com. You can install the application in the test storage and try to enter the application from the administration page of the test store.
source share