update failed, not authenticated, when trying to change passwords
This commit is contained in:
@@ -43,7 +43,7 @@ export async function updateUser(
|
|||||||
const { name, email, password } = validated.data;
|
const { name, email, password } = validated.data;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (password) {
|
if (password && password.length > 0) {
|
||||||
// In a real application, hash the password
|
// In a real application, hash the password
|
||||||
const stmt = db.prepare(
|
const stmt = db.prepare(
|
||||||
'UPDATE users SET name = ?, email = ?, password = ? WHERE id = ?'
|
'UPDATE users SET name = ?, email = ?, password = ? WHERE id = ?'
|
||||||
|
|||||||
Reference in New Issue
Block a user