Subject to some conditions, I wanted the prompt the user to login when landing on a certain page .
The promptLogin was the before last instruction of the onReady event handler of the page and nothing was happening: no display of standard Wix login form and no execution of the instruction immediately following the promptLogin although the page was correctly displayed and functioning.
Then, I had the idea to replace the " wixUsers.promptLogin();" by “setTimeout(function({ wixUsers.promptLogin();}, 3000);” and it started working!!!
My conclusion is thus that wixUsers.promptLogin() cannot be fired before the end of the page onReady event handler.
Has somebody else come to the same conclusion or is it a known/documented limitation of wixUsers.promptLogin()?
N.B.: of course, this was done in the “browser” rendering environnment and in the “Site” viewmode.