Kyon147 / laravel-shopify

A full-featured Laravel package for aiding in Shopify App development
MIT License
331 stars 98 forks source link

Missing Auth Url on installation #260

Closed Ansari-techs closed 5 months ago

Ansari-techs commented 6 months ago

WhatsApp Image 2024-01-06 at 4 33 01 PM

M4tini commented 6 months ago

Same here, using release v19.2.0 on Laravel 8 / PHP 8.2 and Shopify API version 2023-10

Osiset\ShopifyApp\Exceptions\MissingAuthUrlException:
Missing auth url

  at /opt/app/vendor/kyon147/laravel-shopify/src/Traits/AuthController.php:55
nebsta9 commented 5 months ago

i had the same issue, I manage to solve this by adding my store password into the users table in the database

Kyon147 commented 5 months ago

Missing auth URL usually means the set up is not correctly configured i.e. your api keys or urls.

Ansari-techs commented 5 months ago

Missing auth URL usually means the set up is not correctly configured i.e. your api keys or urls.

This exception show on some Shopify themes if I change store theme and then install again so it's work correctly. Why this show on some themes?

Ansari-techs commented 5 months ago

@Kyon147 any update?

igorrozzu commented 5 months ago

@Kyon147 @Ansari-techs Have the same error just on first install. All keys in config are set up properly [v19.2.0] on Laravel 10 / PHP 8.3.1 / Shopify API version 2023-10 screen-2024-01-27-14-13-44

Any ideas, workaround how to fix it ?

Kyon147 commented 5 months ago

I'll try a new install and see if the issue happens for me too

Kyon147 commented 5 months ago

Starting a new docker image for one of my apps I did run into this issue.

For me it was broken migrations, so can you check you are running any migrations for your app that you may have missed in the package.

M4tini commented 5 months ago

After some debugging I came to the same conclusion and running the migration (according to the upgrade guide) fixed it.

I saw in my added debug logs that InstallShop encountered a SQL exception, but the final error we all encountered is very obscure. This is caused by InstallShop having a try/catch that ignores the thrown Exception: https://github.com/Kyon147/laravel-shopify/blob/master/src/Actions/InstallShop.php#L113

The combination of returned values 'completed' => false and 'url' => null is not expected by the rest of the app, resulting in the AuthController trying to redirect to an url that is null.

Kyon147 commented 5 months ago

Sounds like the same issue, seems the exception is getting silenced up the stack. So would be a good to make this more visible in the future. I'll create an issue for it.