For those who've built a custom login to avoid the awful defaults, have you tried to launch your site with the 'blank' path, e.g. 'https://yoursiteurl/blank'? This is a default path Wix generates when automatically calling for the user to login, for instance when the user doesn't have permissions to open a page.
Here's what Wix renders under the above circumstance:
Here's how it renders when called from code (properly as designed):
It seems there's no escape from some ugly flaw regarding custom login and Wix code.
Ideas would be appreciated, but if all you've got is references to Wix tutorials that do not address this specific issue, don't bother.