Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MissingAuthUrlException triggered when installing the app on a store with no theme #305

Closed
ajprod opened this issue Apr 30, 2024 · 4 comments

Comments

@ajprod
Copy link

ajprod commented Apr 30, 2024

Expected Behavior

App should be installed normally with no error

Current Behavior

On installation on a new store with no theme, the MissingAuthUrlException is triggered

Failure Information

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. Create a new development store (a few weeks ago, Shopify made a change where new development stores don't have a theme installed)
  2. Install an app through your partners dashboard
  3. MissingAuthUrlException is triggered

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

  • Package Version: v19.2.0
  • Laravel Version: v9.0
  • PHP Version: v8.0.0

Failure Logs

[2024-04-30 07:30:51] local.ERROR: Missing auth url {"userId":1234,"exception":"[object] (Osiset\\ShopifyApp\\Exceptions\\MissingAuthUrlException(code: 0): Missing auth url at /my-app/vendor/kyon147/laravel-shopify/src/Traits/AuthController.php:55)

@sunnyvaniya21
Copy link

@Kyon147 can you please look into this issue ?

@Kyon147
Copy link
Owner

Kyon147 commented May 1, 2024

@sunnyvaniya21 this is likely due to the theme level check that happens, it might need to be tweaked to now not expect being able to find the theme level.

It's likely here or around here that needs debugging https://github.com/Kyon147/laravel-shopify/blob/master/src/Services/ThemeHelper.php#L109

@ClementBolard
Copy link

The error come from the extractStoreMainTheme in the ThemeHelper.
Indeed, Shopify return an empty array of themes.

As a quick fix, you can add a try catch around the call of the Theme Support Level function in the InstallShop.php file in Actions.

try{
     $themeSupportLevel = call_user_func($this->verifyThemeSupport, $shop->getId());
     $this->shopCommand->setThemeSupportLevel($shop->getId(), ThemeSupportLevel::fromNative($themeSupportLevel));
}catch(Exception $e){
     $themeSupportLevel = null;
}

@Kyon147
Copy link
Owner

Kyon147 commented May 16, 2024

#312 adds in your suggestion but have created a new enum for the value for null to keep things consistent

Kyon147 added a commit that referenced this issue May 16, 2024
…e null (#312)

* Try and catch the theme support and any error we keep the theme null

* linting

* linting

* linting
@Kyon147 Kyon147 closed this as completed Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants