Forget Password endpoint always returns status code 200

When I call the forget password endpoint on both postman and my next.js app, I always get status code 200, no error, even if the user doesn't exist. In my next.js logs I can see the user not found error being registered, but my code which looks like this:

async function onSubmit(event: React.SyntheticEvent) {
        event.preventDefault()
        setIsLoading(true)
        setError("")

        const { data, error } = await authClient.forgetPassword({
            email: email,
            redirectTo: "/reset-password",
        });

        setIsLoading(false)


        console.log(data,error);
        
        if (error) {
            setError(error.message!)
            return
        }
        
        toast.success("Reset link sent to your email!")
        //router.push("/auth")
    }


Has data with value {status: true} and error is null

Is this normal behaviour?
A256BDBF-45D6-4483-813F-140EC9325709.png
957B1684-32C5-4FD3-B944-B181869FCE82.png
Solution
I would say for security
Was this page helpful?