I have a setTimeout with logout and a redirect, the redirect works but the logout does not.
Why and how do I fix this?
import wixUsers from ‘wix-users’ ;
import wixLocation from ‘wix-location’ ;
$w . onReady (() => {
console.log(‘1’);
setTimeout (() => {
console.log(‘hit’);
wixUsers . logout ();
wixLocation . to ( ‘/’ );
}, 60000 );
})