Facing issue with handling logged out user using `...
# support-questions
g
Facing issue with handling logged out user using
onHandleEvent
for
supertokens-website
. Here's what I did 1. I logged out the user using
await supertokens.signOut();
2. I added
onHandleEvent
as following
Copy code
supertokens.init({
    apiDomain: "...",
    onHandleEvent: (context) => {
        if (context.action === "UNAUTHORISED") {
            alert("You are not logged in");
            if (context.sessionExpiredOrRevoked) {
              console.log("Session expired or revoked")
            }
        }
    }
})
But I don't see any alert or console log
r
hey
calling sign out doesn't trigger that callback cause it's not an unauthorised event
if you query an API after signing out, then that even will get fired.
2 Views