Relative timing for wix-users onLogin and page onReady

Hey Martin,

You can enter the code inside the onReady() in the site tab.
It will run after the page is ready on every page of the site.
The code in site tab run before the code in page but if it inside the onReady(), it will run after the page is ready before the onReady() of the page.

In order it to work you should import wixUsers before the onReady();

The code in the site tab should look like this:

import wixUsers from 'wix-users';

$w.onReady(function () {
    wixUsers.onLogin((user) => {
     //Do something
    });
});

Best

Binyamin