Integrate Auth0 with Wix Members: Complete Guide

The code does not behaves well for me. Especially the custom header code.
updateUI is sometimes called while there is no registered auth0Id
Instead of calling it in window.onload, (I commented out this line), I’m calling it immediately after we get the auth0Id from window.addEventListener(‘message’, async (event) => {

Also I had to change the ‘Token endpoint authentication method’ in Auth0 to ‘None’, otherwise I kept getting 401 errors from auth0. Don’t if this is correct though from a security perspective

Could you please test this and update the tutorial accordingly if relevant?
Thanks,