parameter in the Kinde auth middleware is not working as expected. When included in the configuration, authentication stops working. If removed, everything works normally.
Current Middleware Implementation import { withAuth } from "@kinde-oss/kinde-auth-nextjs/middleware"
Troubleshooting Steps Taken Confirmed using the latest package version (2.5.3) Tried simplifying the middleware configuration and matcher pattern Verified that removing isReturnToCurrentPage: true resolves the issue Confirmed callback URLs are correctly set in the Kinde dashboard
Expected Behavior When using isReturnToCurrentPage: true, users should be redirected back to the page they were trying to access after successful authentication.
Actual Behavior When isReturnToCurrentPage: true is included in the configuration, the authentication flow breaks. Removing this parameter makes authentication work correctly, but users are not redirected back to their original page.