SignOut doesn't redirect
Why does this not redirect IMMEDIATELY <DropdownMenuItem
              onClick={async () => {
                await authClient.signOut();
              }}
            >
              <LogOut />
              Log out
            </DropdownMenuItem>
2 Replies
@Better Auth @Better Auth Why does this not redirect IMMEDIATELY <DropdownMenuItem
              onClick={async () => {
                await authClient.signOut();
              }}
            >
              <LogOut />
              Log out
            </DropdownMenuItem>
The behavior you're experiencing is due to the asynchronous nature of the sign-out process. By default, calling authClient.signOut() won’t automatically trigger a page redirect—you need to explicitly instruct it to redirect after the sign-out is completed. For example, you can pass a fetchOptions object with an onSuccess handler that performs the redirect:
This ensures that the redirect happens only after the sign-out process finishes, which might not feel "immediate" if the network call or session cleanup takes a moment [1][10].
Sources:
[1] Basic Usage | Better Auth
[10] Redirect after SignOut
Basic Usage | Better Auth
Getting started with Better Auth
GitHub
Redirect after SignOut · Issue #798 · better-auth/better-auth
After Sign Out, I want to redirect, so I think this can be like that: Manually signOut({ redirectUri: "/login" }) or by config createAuthClient({ baseURL: import.meta.env.VITE_API_URL, si...