same thing continues to happen. I cant change credentials... please debo
This commit is contained in:
@@ -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 = ?'
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user