Cant get appState from handleRedirectCallback

Never mind i found the problem, loginWithRedirect takes options object and the targetUrl can be passed there amongst other state properties.

await authClient?.loginWithRedirect({
            appState: {
                targetUrl: pathname + search
            }
        });
5 Likes