jetpackjoe
jetpackjoe4w ago

I think I found a bit of a bug? or at

I think I found a bit of a bug? or at least an unintuitive DX signOut from useAuthActions returns a promise, but awaiting that promise does not guarantee the user is signed out. Here is that I am doing
<button
onClick={async () => {
await signOut();
await router.invalidate();
}}
>
Sign Out
</button>
<button
onClick={async () => {
await signOut();
await router.invalidate();
}}
>
Sign Out
</button>
In my loader, I checked the convex for the current user
async beforeLoad() {
const user = await convex.query(api.user.currentUser);
return { user };
},
async beforeLoad() {
const user = await convex.query(api.user.currentUser);
return { user };
},
But this was still returning the user, even though I am awaiting the signOut. Adding a short sleep between the signOut and the invalidate is a temporary workaround, but I think that if we await signOut then the user should be signed out when that promise resolves.
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?