This PR refactors the global redirect functionality to maintain the loading state of interaction elements (e.g., buttons) until the page is fully redirected after a successful sign-in.
Key changes include:
Updated useGlobalRedirectTo hook to return an async function that never resolves, ensuring the loading state persists.
Modified all calls to redirectTo to use await, preventing premature state updates.
Added detailed comments explaining the purpose and behavior of the useGlobalRedirectTo hook.
Applied this change across various authentication flows, including social sign-in, password sign-in, MFA, and consent pages.
Summary
This PR refactors the global redirect functionality to maintain the loading state of interaction elements (e.g., buttons) until the page is fully redirected after a successful sign-in.
Key changes include:
Testing
Test locally and everything works well.
Checklist
.changeset