Redirect after logout in React SPA

Problem statement

I have a SPA in React where the logout function:

  logoutParams: {
        returnTo: window.location.origin

I have 2 Allowed Logout URLs:, http://localhost:3000 configured
The problem is no matter what environment I am using when I am doing the redirect, is not redirect me to “window.location.origin”, but is redirecting me to the first URL in the list.


const logoutWithRedirect = () =>
      returnTo: window.location.origin,