# Auth0 (Universal Login) and HubSpot Tracking Code (with Collected Forms)

**URL:** <https://community.hubspot.com/t/auth0-universal-login-and-hubspot-tracking-code-with-collected-forms/87589>\
**Category:** APIs & Integrations\
**Tags:** forms\
**Created:** [August 16, 2023, 7:57am UTC](https://community.hubspot.com/t/auth0-universal-login-and-hubspot-tracking-code-with-collected-forms/87589 "2023-08-16T07:57:57Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![fp\_mb](https://avatars.discourse-cdn.com/v4/letter/f/5f8ce5/32.png) [@fp\_mb](https://community.hubspot.com/u/fp_mb)\
**Post date:** [August 18, 2023, 7:58am UTC](https://community.hubspot.com/t/auth0-universal-login-and-hubspot-tracking-code-with-collected-forms/87589/3 "2023-08-18T07:58:54Z")

</div>

Hi Jaycee,

I am a colleague of [@fs\_mb](https://community.hubspot.com/t5/user/viewprofilepage/user-id/616294).

So we have a react SPA with a ( **non-hubspot** ) form (react-hook-form) that hooks onto onSubmit for validation. Once validation passes we call the Auth0-js login which triggers a browser redirect.

This redirect is what (sometimes) cancels the in-flight HubSpot form submission.

Your idea has merit but I don’t know how to wait for the HubSpot (non-hubspot) form submission to finish. The docs mention listening on the window.onmessage but that seems to me to be only for Hubspot forms in an iframe (i.e. not non-hubspot forms).

Could you clarify this for me please?

Thank you!

---

_[View the full topic](https://community.hubspot.com/t/auth0-universal-login-and-hubspot-tracking-code-with-collected-forms/87589)._
