Shopify app proxy returns 302 status code and redirect /auth/login

Topic summary

A developer is experiencing a 302 redirect issue with their Shopify app proxy. The proxy is designed to fetch data from a database and display it in an app theme extension.

Current Behavior:

  • The proxy endpoint returns a 302 status code
  • Redirects to /auth/login instead of serving the expected data
  • Backend console.log statements execute successfully, indicating the server-side code runs
  • Frontend receives the redirect response rather than the intended data

Technical Details:

  • Request URL: https://kitapp-testapp.myshopify.com/apps/badge
  • Status: 302 Found
  • Method: GET
  • Referrer Policy: strict-origin-when-cross-origin

The issue appears to be an authentication/authorization problem where the proxy endpoint is triggering a login redirect despite the backend logic executing. The developer has shared their liquid file and proxy configuration but is seeking help to resolve why the authentication redirect occurs on the frontend.

Summarized with AI on November 3. AI used: claude-sonnet-4-5-20250929.

I have a shopify app proxy so that I can get data from my db and populate it in the app theme extension. Below is my liquid file and proxy file. Everything works good, the console.log is printed when I call the function but in the frontend I keep getting the below response:

Request URL: https://kitapp-testapp.myshopify.com/apps/badge

Request Method: GET

Status Code: 302 Found

Remote Address: [2620:127:f00f:e::]:443

Referrer Policy: strict-origin-when-cross-origin

location: /auth/login