Skip to content

Commit

Permalink
feat: config to enable/disable API scopes validation
Browse files Browse the repository at this point in the history
  • Loading branch information
seka19 committed Nov 10, 2021
1 parent d1ab833 commit 1e667ac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ShopifyApp/Middleware/AuthShop.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ protected function validateShop(Request $request)
);
}

if ($this->validateScopes) {
if ($this->validateScopes && Config::get('shopify-app.api_scopes_validation')) {
$redirect = $this->validateScopes($shop);
if ($redirect) {
return $redirect;
Expand Down
5 changes: 5 additions & 0 deletions src/ShopifyApp/resources/config/shopify-app.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,11 @@
*/
'api_scopes' => env('SHOPIFY_API_SCOPES', 'read_products,write_products'),

/*
* Redirect to authorization if scopes need to be updated
*/
'api_scopes_validation' => (bool) env('SHOPIFY_API_SCOPES_VALIDATION', true),

/*
|--------------------------------------------------------------------------
| Shopify API Grant Mode
Expand Down

0 comments on commit 1e667ac

Please sign in to comment.