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

Authenticate does not work for Proxy routes #305

Closed
sam-masscreations opened this issue Aug 14, 2023 · 1 comment
Closed

Authenticate does not work for Proxy routes #305

sam-masscreations opened this issue Aug 14, 2023 · 1 comment

Comments

@sam-masscreations
Copy link

Proxy route unable to authenticate request and redirects to /auth/login. this same request works fine in the app backend.

export async function loader({request}) {
  const {admin} = await shopify.authenticate.admin(request);

  const response = await admin.graphql(
    `#graphql
    mutation populateProduct($input: ProductInput!) {
      productCreate(input: $input) {
        product {
          id
        }
      }
    }`,
    {
      variables: {
        input: {
          title: 'New product',
          variants: [{price: 100}],
        },
      },
    },
  );
  const parsedResponse = await response.json(); 

  return json({data: parsedResponse});
}

export default function AdditionalPage() {
  return (  
    <div>
      hello
    </div>
  );
}
@byrichardpowell
Copy link
Contributor

Thanks for opening an issue.

I'm going to close this issue as we think it's a duplicate of #295.

We want to make this a priority. So stay tuned.

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

2 participants