// troubleshooting guide · supabase
Supabase 'JWT Expired' Error (PGRST301)
- Status
- Workaround available
- platforms:
- Web, Next.js, Flutter, mobile
- updated:
- November 22, 2026
- reports:
- 4
- Method
- how we research
RUNBOOK · supabase/jwt-expired4 FIXES
// quick answer
The access token (valid about one hour) was not refreshed. Refresh the session or use the SSR middleware; in the dashboard, sync your computer's clock.
Most likely fix: Refresh the session
How to fix it
// try these in order, the most common fix is first
FIX 1Refresh the session
- 01Call supabase.auth.refreshSession() and retry the request
- 02Keep autoRefreshToken enabled on the client
- 03Handle onAuthStateChange so the new token replaces the old one
Did this fix it?FIX 2Next.js and SSR: refresh in middleware
- 01Use the @supabase/ssr package
- 02Create the server client from request cookies
- 03Call supabase.auth.getUser() in middleware so tokens refresh on each request
Did this fix it?FIX 3Dashboard JWT expired
- 01Enable automatic date and time in your OS
- 02Reload the dashboard and sign in again
Did this fix it?FIX 4Check keys
- 01Confirm the key and URL belong to the same project
- 02Don't match on PGRST301 alone: bad signatures and wrong keys give similar errors
Did this fix it?
SANDBOX · supabase RUNS IN YOUR BROWSER
Try it: edit a table, call it from your app, run SQL
A hands-on Supabase-style sandbox, including the spots where users get stuck. See where problems like this one start. 1-2 minutes, nothing is saved.
Symptoms
Requests return 401 with 'JWT expired' or code PGRST301, often after the tab or server has been idle for an hour.
Why it happens
- C-01Session not refreshed after the ~1 hour token lifetime
- C-02Server-side code reusing a stale token
- C-03System clock out of sync (dashboard error)
- C-04Wrong anon key or JWT secret for the project
// this guide also covers
- supabase jwt expired
- pgrst301
- supabase token expired refresh
Still not working?
If Supabase keeps failing, you're not alone. See every Supabase problem users report or the alternatives people switch to.
Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.
Talk to usThe same problem in other apps
Other Supabase errors
- Supabase Project Paused
- Supabase Max Client Connections Reached
- Supabase 'New Row Violates Row-Level Security Policy' Error
- Supabase Confirmation Email Not Sending
- Supabase Auth Redirects to Localhost
- Supabase 'Invalid Refresh Token: Refresh Token Not Found'
- Supabase Edge Function 546 WORKER_LIMIT Error
- Supabase Storage Upload Failed