diff --git a/src/app/(student)/profile/change-password-form.tsx b/src/app/(student)/profile/change-password-form.tsx index 9aa6e49..21d1af9 100644 --- a/src/app/(student)/profile/change-password-form.tsx +++ b/src/app/(student)/profile/change-password-form.tsx @@ -1,7 +1,6 @@ "use client"; import { useState } from "react"; -import { authClient } from "@/lib/auth-client"; const inputStyle: React.CSSProperties = { border: "2px solid var(--border)", @@ -33,14 +32,14 @@ export function ChangePasswordForm() { } setLoading(true); - const result = await authClient.changePassword({ - currentPassword: current, - newPassword: next, - revokeOtherSessions: false, + const res = await fetch("/api/auth/change-password", { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ currentPassword: current, newPassword: next, revokeOtherSessions: false }), }); setLoading(false); - if (result.error) { + if (!res.ok) { setError("Неверный текущий пароль"); return; }