You've already forked obsidian-visualiser
Remove unused components, change zod to v4 and cahnge a few character properties
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { and, count, eq } from 'drizzle-orm';
|
||||
import { z } from 'zod';
|
||||
import { eq } from 'drizzle-orm';
|
||||
import { z } from 'zod/v4';
|
||||
import { usersTable } from '~/db/schema';
|
||||
import { schema as registration } from '~/schemas/registration';
|
||||
import useDatabase from '~/composables/useDatabase';
|
||||
@@ -54,12 +54,12 @@ export default defineEventHandler(async (e) => {
|
||||
message: 'Unauthorized',
|
||||
});
|
||||
}
|
||||
if(!await Bun.password.verify(body.data.oldPassword, check.hash))
|
||||
if(!await Bun.password.verify(body.data.oldPassword as string, check.hash))
|
||||
{
|
||||
return { success: false, error: "Ancien mot de passe incorrect" };
|
||||
}
|
||||
|
||||
db.update(usersTable).set({ hash: await Bun.password.hash(body.data.newPassword) }).where(eq(usersTable.id, session.user.id)).run();
|
||||
db.update(usersTable).set({ hash: await Bun.password.hash(body.data.newPassword as string) }).where(eq(usersTable.id, session.user.id)).run();
|
||||
|
||||
return { success: true };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user