The Prompt BakeryTemplates and prompts

Fix · Supabase and databases

"JWT expired" or user logged out suddenly

Not checked against the vendor's current screens

What you may see

  • After some time requests fail with JWT expired
  • The user must sign in again too often

Most likely cause

The login token is short lived and must be renewed; the renewal does not happen, because the session code is missing or the cookie is lost.

Check first (about two minutes)

  1. Does it fail after about an hour, or right away?

The fix prompt

What you type here never leaves your browser. The search runs on this page, and nothing is sent to a server or to an AI.

Kept only in this browser, on this device. Keys and passwords are removed before anything is saved.

Prompt language

Paste it into Claude, ChatGPT, Gemini or Cursor, then follow what it says.

After you tried it, did it work?

Steps

  1. Check how the app creates the Supabase client and whether automatic token refresh is on.
  2. For a server-rendered app, check the session refresh runs in the proper place (middleware or the documented helper) and cookies are written back.
  3. Handle the expired case with a clear message and a way to sign in again.

Do not do this

  • Do not store tokens in places other than the library's own storage.
  • Do not make tokens last forever.

Related

Try another entry

How can we help?

What do you need?
Your email, so we can reply (optional)Only enter your own email. We reply there.