diff --git a/docs/content/docs/concepts/users-accounts.mdx b/docs/content/docs/concepts/users-accounts.mdx
index bbc00145d7..e5ad593c61 100644
--- a/docs/content/docs/concepts/users-accounts.mdx
+++ b/docs/content/docs/concepts/users-accounts.mdx
@@ -140,6 +140,21 @@ await auth.api.setPassword({
headers: await headers() // headers containing the user's session token
});
```
+### Verify Password
+
+The `verifyPassword` function allows you to verify a user's current password. This is useful for confirming user identity before performing sensitive operations like updating security settings. This function can only be called from the server.
+
+```ts
+await auth.api.verifyPassword({
+ body: {
+ password: "user-password" // required
+ },
+ headers: await headers() // headers containing the user's session token
+});
+```
+
+For OAuth users who don't have passwords, consider using email verification or fresh session checks for sensitive operations instead.
+
## Delete User
@@ -453,8 +468,10 @@ Users already signed in can manually link their account to additional social pro
```ts
await auth.api.setPassword({
- headers: /* headers containing the user's session token */,
- password: /* new password */
+ body: {
+ newPassword: "new-password", // required
+ },
+ headers: await headers() // headers containing the user's session token
});
```
diff --git a/packages/better-auth/src/api/index.ts b/packages/better-auth/src/api/index.ts
index da32e41f9c..cebe6e77bb 100644
--- a/packages/better-auth/src/api/index.ts
+++ b/packages/better-auth/src/api/index.ts
@@ -42,6 +42,7 @@ import {
unlinkAccount,
updateUser,
verifyEmail,
+ verifyPassword,
} from "./routes";
import { toAuthEndpoints } from "./to-auth-endpoints";
@@ -216,6 +217,7 @@ export function getEndpoints