[PR #2678] [CLOSED] Verify password in auth.api.verifyPassword #21336

Closed
opened 2026-04-15 20:17:45 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/2678
Author: @izadoesdev
Created: 5/16/2025
Status: Closed

Base: mainHead: verify-password


📝 Commits (4)

📊 Changes

5 files changed (+597 additions, -222 deletions)

View changed files

📝 packages/better-auth/src/api/index.ts (+2 -0)
📝 packages/better-auth/src/api/routes/index.ts (+1 -0)
packages/better-auth/src/api/routes/verify-password.test.ts (+74 -0)
packages/better-auth/src/api/routes/verify-password.ts (+133 -0)
📝 pnpm-lock.yaml (+387 -222)

📄 Description

Added

  • New verifyPassword API endpoint to check if a user's password is valid.
    • Accepts either the authenticated user or an email.
    • Returns { valid: boolean } in the response.

This allows users to verify their password / re-authorize for sensitive actions.

Tests

  • Added comprehensive tests for the verifyPassword endpoint, covering:
    • Authenticated and unauthenticated (email) flows
    • Valid and invalid password checks
    • Error cases for missing email and non-existent users

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/2678 **Author:** [@izadoesdev](https://github.com/izadoesdev) **Created:** 5/16/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `verify-password` --- ### 📝 Commits (4) - [`7ab451f`](https://github.com/better-auth/better-auth/commit/7ab451f597b9fdd861bde992ddcf3d1050ba5124) feat: auth.api.verifyPassword - [`c20b1ca`](https://github.com/better-auth/better-auth/commit/c20b1caf5a2732af92feb855ee217685cd8ad471) feat: auth.api.verifyPassword - [`cdfcabc`](https://github.com/better-auth/better-auth/commit/cdfcabc4efb226a856ac89caca178dcd030fe6d8) Merge branch 'main' of https://github.com/izadoesdev/better-auth - [`a8f882a`](https://github.com/better-auth/better-auth/commit/a8f882a31123373fce4590a9ac650eaa5b231fd7) revert: package changes ### 📊 Changes **5 files changed** (+597 additions, -222 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/api/index.ts` (+2 -0) 📝 `packages/better-auth/src/api/routes/index.ts` (+1 -0) ➕ `packages/better-auth/src/api/routes/verify-password.test.ts` (+74 -0) ➕ `packages/better-auth/src/api/routes/verify-password.ts` (+133 -0) 📝 `pnpm-lock.yaml` (+387 -222) </details> ### 📄 Description ### Added - New `verifyPassword` API endpoint to check if a user's password is valid. - Accepts either the authenticated user or an email. - Returns `{ valid: boolean }` in the response. ## This allows users to verify their password / re-authorize for sensitive actions. ### Tests - Added comprehensive tests for the `verifyPassword` endpoint, covering: - Authenticated and unauthenticated (email) flows - Valid and invalid password checks - Error cases for missing email and non-existent users --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-15 20:17:45 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#21336