How do I solve for a persisting session on Next-auth when User is deleted from DB.
I am currently finding that My user auth sessions are persisted even when I have cleared my db. What is the cleanest way around this. If possible kindly share a solution when using the jwt strategy as well
9 Replies
cascading
show your model for the sessions
wait what
oh you're using jwt's
yeah just dont use jwt's
this is simply a flaw with jwt's
okay, and there's no way to go around it when using jwts ?
☠️ just dont use jwts
okay, noted. Kind sir 😅
but if you do use jwt
dont use long living ones
like 1~2 minutes of ttl
and keep refreshing
is it, possible to make the nextjs middleware feature work with the database strategy on nextauth?