Password Protection breaks your custom code

Hi Support team,
I embedded a webapp (Code) onto a webpage. It works great until I set a password to lock the page. Once I set the password and log in, the code for my webapp no longer runs on the page. Please let me know how we can work around this.