The TAB and DOMAIN constants were out of scope inside the OnEvents() function. They are now passed as parameters.
Fixed the URL of the "forgot password" link in the sign-in form.