How to Detect Logout?

Hello,

You can use the wixusers.logout function to log users out. If you wanted to just check when the user has logged out you can run a condition that checks if a user is not logged in.

I created a simple example for demonstration:

import wixUsers from 'wix-users';

$w.onReady(function () {
 let user = wixUsers.currentUser;
 let isLoggedIn = user.loggedIn;

 if(!isLoggedIn){
        console.log("Not logged in");
    }
})

See currentuser API

I hope this helps!

Best regards,
Miguel