logto-io/js

Bug: Incorrect Return Value from isSignInRedirected in watchEffect

Closed this issue · 1 comments

watchEffect(() => {
const currentPageUrl = window.location.href;
if (!isAuthenticated.value && logtoClient.value?.isSignInRedirected(currentPageUrl)) {
void handleSignInCallback(currentPageUrl, callback);
}
});

The code provided in the watchEffect block has a bug that causes the isSignInRedirected function to always return true, regardless of its actual logic. This issue arises because the function isSignInRedirected is an async function and is called without awaiting its execution.

Thanks for reporting. This is a critical bug and should've been noticed earlier.