ErrorsPostgREST

PGRST301

The token your app sent was rejected

The request carried a token the database could not accept — expired, malformed, or signed with a key that does not match the project it was sent to.

Why it happens

In an AI-built app, specifically

Two common causes in a published app. Either the session expired and the client never refreshed it, so every request after that point fails while the page still looks signed in. Or the app is pointed at one Supabase project with a key from another — which happens the moment a second project gets created and only half the configuration is updated.

Steps

How to fix it

  1. 01Sign out and back in. If everything works again, the problem is session refresh rather than configuration.
  2. 02Compare the Supabase project URL and the key in your production environment. They must come from the same project — a mismatched pair produces exactly this.
  3. 03If you rotated keys recently, rebuild and republish. The key is baked in at build time, so rotating it without a rebuild leaves the old one in the bundle.
Still stuck

If the steps did not do it

An error is one symptom, and the cause is often somewhere else entirely. The broken-app check reads your published site and looks at everything at once — and if it cannot tell either, connecting your repository is what lets Refinar read the code and fix it.

Got feedback that's been waiting for weeks? Ship it today.