Any way to remove Logout or be notified when a user logs out (Iframe integration)

I’m showing RocketChat inside an Iframe. I can log in users without any problem. However, I would like to control how a user logs out. Right now, if a user logs out, they still remain inside the iframe. If I could get notified when this happens outside the iframe, I could take them to another page and problem solved. Another solution would be to remove the logout option in RocketChat altogether, so that I can log them out at the same time they log out of my site.

Any ideas how this could be achieved? Thanks in advance.