Session doesn’t get invalidated after the user is deleted
I tested what would happen if I deleted a user manually from the database and when I refreshed the page it stayed in the same page, it didn’t redirect to the auth page. I tried using these 2 method in the middleware:
- https://www.better-auth.com/docs/integrations/next#for-nextjs-release-1517-and-below
-
getSessionCookie()
and got the same result, it thinks the session still exists, also the better-auth.session_token
cookie doesn't get deleted either. How to solve this issue? It’s been a day and I still haven’t figured it out. Any help would be appreciated!Next.js integration | Better Auth
Integrate Better Auth with Next.js.
0 Replies