fix(auth): use correct Better Auth API method for password reset

Change from auth.api.forgetPassword to auth.api.requestPasswordReset
to match Better Auth's actual endpoint naming.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Till-JS 2026-01-26 15:20:16 +01:00
parent f173a2287e
commit 8e1f44369a

View file

@ -870,13 +870,14 @@ export class BetterAuthService {
redirectTo?: string
): Promise<{ success: boolean; message: string }> {
try {
// Better Auth's forgetPassword method
// Better Auth's requestPasswordReset endpoint
// See: https://www.better-auth.com/docs/authentication/email-password#password-reset
await (this.auth.api as any).forgetPassword({
await (this.auth.api as any).requestPasswordReset({
body: {
email,
redirectTo,
},
headers: new Headers(),
});
// Always return success to prevent email enumeration