How to detect and handle OAuth error when using Okta Sign in Widget

When an incorrect configuration is passed to the Okta Sign In Widget I get an error that appears to be returned via the LoginCallback. But it’s not handled as part of the showSignInToGetTokens() error path. It appears it’s an OAuth error that gets returned to the browser.

It causes an infinite loop in my application because my login page is where the Okta Sign In Widget resides so each time the page is refreshed, the device-challege-poll fails and it redirects back to this page and tries again.

How do I detect and handle an invalid configuration when using the Okta Sign in Widget?