Client side session isn't removed after deleting user

Whenever I delete a user. the client side session isn't removed and still there until I refresh the page. Here is delete user logic:
await authClient.deleteUser({
fetchOptions: {
onSuccess: () => {
toast({
variant: "destructive",
title: t(`toast.deleted`),
});
router.push(DEFAULT_UNAUTHENTICATED_REDIRECT);
},
},
});
await authClient.deleteUser({
fetchOptions: {
onSuccess: () => {
toast({
variant: "destructive",
title: t(`toast.deleted`),
});
router.push(DEFAULT_UNAUTHENTICATED_REDIRECT);
},
},
});
Check the attachements for the UI after deleting the account. Tech stack: 1- "next": "^14.2.23", 2- "better-auth": "^1.1.15",
No description
3 Replies
bekacru
bekacru5w ago
should be fixed on 1.1.16-beta.3
Maqed
MaqedOP5w ago
Ok cool! Is there a way to fix that for now? And also, Thank you so much for maintaining such a cool project! I'm migrating from next-auth
bekacru
bekacru5w ago
It should already be released. you can install it pnpm i better-auth@beta

Did you find this page helpful?