Verify password API endpoint expires session when password is wrong

Hey there,
When I try to send a password to the verify password endpoint: “frappe.core.doctype.user.user.verify_password(password)”, the session gets invalidated when the password is wrong as opposed to it returning an error.

Is there any other method I can use to validate the user’s password that wouldn’t do this?