So, the solution ended up to be quite trivial. The only thing I missed is adding the appState.target
property to the parameters of the loginWithRedirect
method. So in case you're facing the same issue, do this:
auth0.loginWithRedirect({
appState: {
target: "/auth-callback"
}
});