Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

AuthShop middleware failing with bulk actions #336

Closed
marko-behm opened this issue Oct 1, 2019 · 2 comments
Closed

AuthShop middleware failing with bulk actions #336

marko-behm opened this issue Oct 1, 2019 · 2 comments
Assignees
Labels
bug Bug with the code

Comments

@marko-behm
Copy link

For bug reporting only! If you're posting a feature request or discussion, please ignore.

Expected Behavior

AuthShop should be able to validate requests with ids parameter which gets set when using bulk actions from Shopify (ie. selecting multiple products -> actions -> "custom bulk action")

Current Behavior

Authentication fails because only id parameter is processed.

Failure Information

See OhMyBrew\ShopifyApp\Middleware\AuthShop::getQueryDomain()
$id = $request->input('id') ?? null;

foreach (compact('code', 'locale', 'state', 'id') as $key => $value) {
if ($value) {
$verify[$key] = $value;
}
}

fixed:
// 2019-10-01 There is ids (array) parameter when receiving request from bulk operations
$ids = $request->input('ids') ?? null;

foreach (compact('code', 'locale', 'state', 'id', 'ids') as $key => $value) {
if ($value) {
$verify[$key] = is_array($value) ? '["' . implode('", "', $value) . '"]' : $value;
}
}

Same fix should be in all getXXXDomain() methods where validation occurs.

Steps to Reproduce

  1. Step 1
    Add bulk action on products page
  2. Step 2
    select multiple products and choose your bulk action

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: 10.0
  • Laravel Version: 6.0
  • PHP Version: 7.2

Failure Logs

Unable to verify signature.

@gnikyt
Copy link
Owner

gnikyt commented Oct 1, 2019

Interesting...thanks I'll adjust for this tonight

@gnikyt gnikyt self-assigned this Oct 3, 2019
@gnikyt gnikyt added fix-in-progress In progress bug Bug with the code labels Oct 3, 2019
gnikyt added a commit that referenced this issue Oct 4, 2019
@gnikyt gnikyt added status-resolved and removed fix-in-progress In progress labels Oct 4, 2019
@gnikyt
Copy link
Owner

gnikyt commented Oct 4, 2019

Thank you will be in next release.

@gnikyt gnikyt closed this as completed Oct 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Bug with the code
Projects
None yet
Development

No branches or pull requests

2 participants