same thing continues to happen. I cant change credentials... please debo

This commit is contained in:
Leon Serfaty G
2025-07-17 11:36:27 +00:00
parent 1d2b63ae70
commit 36159df66d
2 changed files with 7 additions and 3 deletions
+2 -2
View File
@@ -4,7 +4,7 @@
import db from '@/lib/db';
import type { User } from '@/lib/types';
import { z } from 'zod';
import { auth } from '@/app/api/auth/[...nextauth]/route';
import { auth } from '@/lib/auth';
const UserUpdateSchema = z.object({
name: z.string().min(1, 'Name is required'),
@@ -46,8 +46,8 @@ export async function updateUser(
const { name, email, password } = validated.data;
try {
// In a real application, you should hash the password!
if (password && password.trim().length > 0) {
// In a real application, hash the password
const stmt = db.prepare(
'UPDATE users SET name = ?, email = ?, password = ? WHERE id = ?'
);