ruby on rails - Do I need to manually destroy a session on Shopify app uninstall?
I'm using the shopify_app gem.
The issue occurs when I install my app, then uninstall, then try to re-install. I am redirected from the app Oauth login page to my logged-in shop with a "app not found" message.
This leads me to believe that maybe session data is not being destroyed when the app is uninstalled, but I'm not sure how to fix this. I assume that I don't need a webhook to destroy a session.
Can you spot anything wrong in my setup?
Rails.application.routes.draw do scope '/hooks', :controller => :hooks do post :new_customer_callback post :app_uninstalled_callback end root :to => 'home#index' mount ShopifyApp::Engine, at: '/' end class SessionsController < ApplicationController include ShopifyApp::SessionsController end class AuthenticatedController < ApplicationController before_action :login_again_if_different_shop around_filter :shopify_session layout ShopifyApp.configuration.embedded_app? ? 'embedded_app' : 'application' helper_method :current_shop end
if Rails.configuration.cache_classes ShopifyApp::SessionRepository.storage = 'Shop' else ActionDispatch::Reloader.to_prepare do ShopifyApp::SessionRepository.storage = 'Shop' end end
This is just an idea. Could it be that you are not updating your access token when you are re-installing your app?
This is because when you uninstall the access token is no longer valid and your app could still be trying to use the old access token in your db.
Didn't find the answer?
Our community is visited by hundreds of Shopify development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.