srtill admin cant change password, what other auth method could we use?

This commit is contained in:
Leon Serfaty G
2025-07-18 02:54:06 +00:00
parent a49bd1d6e6
commit 56806076a1
-2
View File
@@ -57,7 +57,6 @@ export async function updateUser(
const userId = session.user.id; const userId = session.user.id;
try { try {
// Check if another user with the same email exists
const existingUserStmt = db.prepare('SELECT id FROM users WHERE email = ? AND id != ?'); const existingUserStmt = db.prepare('SELECT id FROM users WHERE email = ? AND id != ?');
const existingUser = existingUserStmt.get(email, userId); const existingUser = existingUserStmt.get(email, userId);
@@ -66,7 +65,6 @@ export async function updateUser(
} }
if (password && password.trim().length > 0) { if (password && password.trim().length > 0) {
// In a real app, you would hash the password here
const stmt = db.prepare( const stmt = db.prepare(
'UPDATE users SET name = ?, email = ?, password = ? WHERE id = ?' 'UPDATE users SET name = ?, email = ?, password = ? WHERE id = ?'
); );