Login loop after enabling MFA

Without MFA enabled, login into my application works fine. When I enable MFA:

  • After entering the one-time code, my application loads with a blank page
  • In the javascript console, I see “Multifactor authentication required”

If I refresh the page, I’m prompted to enter the code again (skipping the first part of login).

I feel like there is a misconfiguration somewhere but I’m not sure where to look.

My application is a nodejs app with HAProxy in front if that makes a difference.