Issue with OAuth flow when reinstalling app from Uninstalled tab

I have a custom Shopify app that installs correctly via the shop domain. The OAuth flow works as expected: the merchant enters shop domain in form in my app, then redirected to Shopify for approval, then back to my app URL where I exchange the code for an access token and complete installation. After that, redirects to the app preview page on shopify iframe app view.

The problem happens when the app is uninstalled and then reinstalled from Apps > Uninstalled. In this case, Shopify does not redirect to my app URL again, and no code parameter is provided, so I cannot regenerate an access token.

Questions:

  1. How should access tokens be regenerated when an app is reinstalled from the Uninstalled tab?
  2. Alternatively, is there a way to prevent the app from being reinstallable from the Uninstalled list and require installation only via the app URL? (like the Shopify GraphiQL App)

Any guidance or best practices would be appreciated. Thanks!

Hi @arifursdev, are you seeing any error messages or warning messages when you attempt to reinstall from Apps > Uninstalled?

I get this with my app which uses the legacy install flow with OAuth:

Is that not what you’re seeing on your end?

Hello @Paige-Shopify, No, I haven’t encountered this issue. I think this could be the redirect uri parameter that you pass when you’re redirect to this page.

I have solved my issue via refreshing access token using id_token.

Oh I see, thanks for sharing what worked. Glad you were able to get it sorted out!