Skip to content

Error: keeps redirecting to log in "component" when submitting the form - With proposed solution #32

@EnricoSottile

Description

@EnricoSottile

I've found the same issue described by other user, eg:
https://community.shopify.com/t/authentication-issue-on-clicking-every-s-link-in-the-qrcode-tutorial/570129

I'm not going to explain it in details - just follow the tutorial and try to create a QR code, when hitting "save" there's the redirect.

The solution for me was to prevent the form event to bounce up.
File: app.qrcodes.$id.jsx

  function handleSave(event) {
    event.preventDefault(); // add this line here (and of course the arg above)
    

    const data = {
      title: formState.title,
      productId: formState.productId || "",
      productVariantId: formState.productVariantId || "",
      productHandle: formState.productHandle || "",
      destination: formState.destination,
    };

    submit(data, { method: "post" });
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions