Spree engines mounted at locations other than the root "/" url, Omniauth middleware intercepts the wrong URL

... middleware was not properly intercepting the request and causing an error page when clicking on any links.