https://supertokens.com/ logo
#support-questions
Title
# support-questions
g

gitcommitshow

04/27/2022, 5:07 AM
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

rp

04/27/2022, 5:09 AM
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