How to handle deleted user?
I have a next app set up with auth using better-auth. I'm using basic middleware like this
Everything was running normally until I tested what would happen if I deleted a user manually from the database, including their session and then I did delete a user. After that, the app threw this error
Error: Missing <html> and <body> tags in the root layout. Read more at
There is still better-auth.session_token
in the cookie tho, so it seems like the middleware doesn't do its job properly, but I'm clueless why it doesn't check the cookie or invalidate the cookie. What am I missing here?0 Replies