Redirecting is not supported (yet). Internet Identity uses window post messages.
Logging in would be successful when your window receives the authorize-client-success message through post message.
In your code, the “// Step 3: Listen for the app scheme callback” is not according to the II spec.
According to the II protocol you need to then initiate a connection with window post messages.
there is an example implementing the protocol in the test-dapp demo.
Does this help?